0% found this document useful (0 votes)
8 views3 pages

Nested Loop Practice

The document contains a list of programming tasks that involve creating various patterns and calculations using loops. It includes tasks for displaying numerical sequences, shapes, and patterns, as well as finding prime, Armstrong, perfect, and palindrome numbers. Additionally, it covers input handling for user-defined ranges and calculations like factorials and averages.

Uploaded by

mirabnaeem27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Nested Loop Practice

The document contains a list of programming tasks that involve creating various patterns and calculations using loops. It includes tasks for displaying numerical sequences, shapes, and patterns, as well as finding prime, Armstrong, perfect, and palindrome numbers. Additionally, it covers input handling for user-defined ranges and calculations like factorials and averages.

Uploaded by

mirabnaeem27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Nested Loop

1. Write a program that displays the following output:


1=1
1+2=3
1+2+3=6
1 + 2 + 3 + 4 = 10
1 + 2 + 3 + 4 + 5 = 15
2. Write a program that displays the following shape:
*******
******
*****
****
***
**
*
3. Write a program that displays the following pattern:

*******
*******
*******
*******
*******
*******
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

You might also like