Assignment 3: Loops
1. Write a program to print 1 to 10.
2. Write a program to print the values between two entered numbers.
3. Write a program to print 2, 4, 6, 8, 10.
4. Write a program to print 1, 3, 5, 7, 9.
5. Write to program to print 1, 2, 4, 8, 16, 32, 64, 128
6. Write to program to print 10 to 1
7. Write a program to print 1, 10, 2, 9, 3, 8, 4, 7, 5, 6.
8. Write a program to print the first 100 even numbers.
9. Write a program to print the first 100 odd numbers.
10. Write a program to print a total of 1 to 50.
11. Write a program to print the table of 5.
12. Accept one number from the user and display the sum of its digits.
13. Accept one number from the user and display the reverse of it.
14. Accept one number from the user and display its factorial.
15. Accept one number from the user and find if it is prime or not.
16. Accept one number from the user and find if it is Armstrong or not (If sum of cubes of each
digit of the number is equal to the number itself, then the number is called an Armstrong
number.).
17. Print Fibonacci series. 0 1 1 2 3 5 8 13 21 34 55 … upto n
18. Write a program to enter the numbers till the user wants and at the end it should display the
count of positive, negative and zeros entered.
19. Write a program to enter the numbers till the user wants and at the end it should display the
maximum and minimum number entered.
Page 1 of 1