Nested Loop Practice
Nested Loop Practice
*******
*******
*******
*******
*******
*******
4. Write a program that displays the following pattern using the do while loop:
666666
55555
4444
333
22
1
5. Write a program that displays the following pattern:
******
*****
****
***
**
*
6. Write a program that displays the following pattern:
*
**
***
****
*****
******
7. Write a program that displays the following pattern:
123456
12345
1234
123
12
1
8. Write a program that displays the following pattern:
*
**
***
****
*****
******
9. Write a program to find the smallest, largest and average of all the numbers of first n whole
numbers.
10. Write a program that inputs a number from the user prints all Armstrong numbers from 1
to the entered number.
11. Write a program that inputs a number from the user prints all Perfect numbers from 1 to
the entered number.
12. Write a program that inputs a number from the user prints all Palindrome numbers from 1
to the entered number.
13. Write a program that inputs a number from the user print factorial of all numbers from 1 to
the entered number.
14. Write a program that inputs n numbers from the user and displays total positive numbers
and negative numbers.
15. Write a program that inputs the n numbers from the user and find whether the input
number is even or odd and find that whether it is prime or not. At the end the program
should displays all total number of even, off and prime numbers entered by user.
16. Write a program that inputs the starting and ending point from the user and displays all
the prime numbers in the given range.
17. Write a program that displays the following pattern:
*******
* *
* *
* *
* *
* *
*******
18. Write a program that displays the following pattern:
123456
12345
1234
123
12
1
19. Write a program that displays the following pattern:
1
12
123
1234
12345
123456
20. Write a program that displays the following pattern:
1
12
123
1234
12345
123456
21. Write a program that displays the following pattern:
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25
22. Write a program that displays the following pattern:
12468
22468
32468
42468
52468