### Exercise questions on loops

1. WAP to generate table of input number. (Solution)
2. WAP to find sum of n natural numbers. (Solution)
3. WAP to find factorial of input number. (Solution)
4. WAP to generate Fibonacci series: 0 1 1 2 3 5 8 … n (Solution)
5. WAP to generate LUCAS SEQUENCE: 1 3 4 7 11 18 … n
6. WAP to print a sequence 1, 3, 6, 10, 15, 21 … n
7. WAP to find a input number is prime or not.
8. WAP to find a Input number is composite or not.
9. WAP to reverse a number. E.g: Input: 123, Output: 321.
10. WAP to find sum of digits.
11. Input number and find it is palindrome or not.
12. WAP to calculate a power b. E.g: ab. Value of a and b is input via keyboard.
13. Find sum of series: 1 – 2 + 3 – 4 + 5 – 6 + 7 – 8 … n
14. Find sum of series: 1 + 2 + 3 – 4 + 5 + 6 – 7 + 8 + 9 – 10 … n
15. Input number of terms and calculate sum of series: 12 + 22 + 32 + 42 … n
16. WAP to calculate LCM of 2 input numbers.
17. WAP to calculate HCF of 2 input numbers.
18. WAP to calculate the prime factors of input number. E.g: prime factors of 24 is 2, 2, 2 and 3.
19. Input number and check it is perfect number or not. Perfect numbers are: 6, 28, 496, 8128
20. Input decimal number and convert into its equivalent binary number.
21. Input number and find it is Armstrong number or not.