ITERATIVE STATEMENTS PROGRAMS
Q1. Write a program to accept an integer and print the multiplication table of that number till 10.
Q2. Write a program to accept an integer and display the factorial of that number. Eg: if the number is 3 then 3! is 6.
Q3. Write a program to accept an integer and generate the divisors of that integer. Eg: If the number is 6 then its divisors are 1 2 3 6.
Q4. Write a program to print first ‘n’ odd numbers in descending order. Eg: if number is 10, then the output is 9 7 5 3 1.
Q5. Write a program to accept the number of terms of the Fibonacci series and print the series till that term. ie.,0 1 1 2 3 5 8 ……….
Q6. Write a program to find the sum of a Series 1/1! + 2/2! + 3/3! + 4/4! +…….+ n/n!
Q7. Write a program to input x and the number of terms and finds the sum of series: 1 + x^2/2 + x^3/3 + … x^n/n.
Q8. Write a program to find the sum of the series a, a + d, a + 2d, a + 3d, . . . .
Q9. Write a program to print the sum of the following series. Accept the value for ‘x’ and the number of terms of the series. 1 – x2 + x4 – x6 + ……………………. xn.
Q10. Write a program to accept the number of lines and print the following pattern. Eg: If the number of lines is 4, then the pattern should be as follows.
*
* *
* * *
* * * *
Q11. Write a program to accept the number of lines and print the following pattern. Eg: If the number of lines is 4, then the pattern should be as follows.
A
BB
CCC
DDDD
Q12. Write a program to accept the number of lines and print the following pattern. Eg: If the number of lines is 4, then the pattern should be as follows.
* * * *
* * *
**
*
Q13. Write a program to accept the number of lines and print the following pattern. Eg: If the number of lines is 3, then the pattern should be as follows.
A
A B
A B C
Q14. Write a program to accept the number of lines and print the following pattern. Eg: If the number of lines is 4, then the pattern should be as follows:
1
1 2
1 2 3
1 2 3 4
Q15. Write a program to accept an integer and check whether it is a prime number or not and display proper messages.
Q16. Write a program to accept an integer and check whether it is palindrome or not and display proper messages.
Q17. Write a program to accept an integer and check whether it is an Armstrong number or not and display proper messages.
Q18. Write a program to accept two integers and find the LCM and GCD of these numbers and display it.
Q19. Write a program to accept an integer and find the sum of digits of that number and display it.
Q20. Write a program to accept an integer and display the reversed integer (store the reversed number in a variable). Eg: If the number is 267 then the reversed number is 762.
Q21. Write a program to print the sum of negative numbers, sum of positive even numbers, sum of positive odd numbers from a list of numbers entered by the user. The list terminates when the num entered is zero.
Q22. Write a program to print all prime numbers from 1 to ‘n’. Accept the value for ‘n’ from the user. Eg: If number is 10, then the output is 2 3 5 7
0 Comments
Please don't Add spam links,
if you want backlinks from my blog contact me on rakeshmgs.in@gmail.com