1.

Take 10 integers from keyboard using loop and print their average value on the screen.

2.

Print the following patterns using loop :

a.

*

**

***

****

b.

*

***

*****

***

*

c.

1010101

10101

101

1

a.

*

**

***

****

b.

*

***

*****

***

*

c.

1010101

10101

101

1

3.

Print multiplication table of 24, 50 and 29 using loop.

4.

Write an infinite loop.

A inifinte loop never ends. Condition is always true.

A inifinte loop never ends. Condition is always true.

5.

Factorial of any number n is represented by n! and is equal to 1*2*3*....*(n-1)*n. E.g.-

4! = 1*2*3*4 = 24

3! = 3*2*1 = 6

2! = 2*1 = 2

Also,

1! = 1

0! = 1

Write a program to calculate factorial of a number.

4! = 1*2*3*4 = 24

3! = 3*2*1 = 6

2! = 2*1 = 2

Also,

1! = 1

0! = 1

Write a program to calculate factorial of a number.

6.

Write a program to find greatest common divisor (GCD) or highest common factor (HCF) of given two numbers.

7.

Take integer inputs from user until he/she presses q ( Ask to press q to quit after every integer input ). Print average and product of all numbers.

1.

Calculate the sum of digits of a number given by user. E.g.-

INUPT : 123 OUPUT : 6

INUPT : 12345 OUPUT : 15

INUPT : 123 OUPUT : 6

INUPT : 12345 OUPUT : 15

2.

A three digit number is called Armstrong number if sum of cube of its digit is equal to number itself.

E.g.- 153 is an Armstrong number because (1^{3})+(5^{3})+(3^{3}) = 153.

Write all Armstrong numbers between 100 to 500.

E.g.- 153 is an Armstrong number because (1

Write all Armstrong numbers between 100 to 500.

3.

Write a program to print a number given by user but digits reversed. E.g.-

INPUT : 123 OUTPUT : 321

INPUT : 12345 OUTPUT : 54321

INPUT : 123 OUTPUT : 321

INPUT : 12345 OUTPUT : 54321

4.

Write a program to find prime factor of a number.

If a factor of a number is prime number then it is its prime factor.

If a factor of a number is prime number then it is its prime factor.

5.

Write a program to print all prime number in between 1 to 100.