Looping Sheet
Looping Sheet
Sample Output:
*
**
***
****
*****
2. Write a program in C++ to display the pattern like right angle triangle with
number.
Sample Output:
Input number of rows: 5
1
12
123
1234
12345
3. Write a C++ program that makes a pattern such as a right angle triangle
using numbers that repeat.
Sample Output:
Input number of rows: 5
1
22
333
4444
55555
4. Write a C++ program to make such a pattern like a right angle triangle
with the number increased by 1.
Sample Output:
Input number of rows: 4
1
2 3
4 5 6
7 8 9 10
Sample Output:
Input number of rows: 4
1
2 3
4 5 6
7 8 9 10
*
* *
* * *
* * * *
* * * * *
Sample Output:
Input number of rows: 5
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
8. Write a C++ program that displays the pattern like a pyramid using
asterisks, with odd numbers in each row.
Sample Output:
Input number of rows: 5
*
***
*****
*******
9. Write a C++ program to print Floyd's Triangle.
Sample Output:
Input number of rows: 5
1
01
101
0101
10101
*
***
*****
*******
*********
*******
*****
***
*
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
12. Write a C++ program to display Pascal's triangle like a right angle
triangle.
Sample Output:
Input number of rows: 7
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
13. Write a program in C++ to display such a pattern for n number of rows
using numbers. Odd numbers will appear in each row. The first and last
number of each row will be 1 and the middle column will be the row
number.
Sample Output:
1
121
12321
1234321
123454321
14. Write a program in C++ to display the pyramid pattern using the
alphabet.
Sample Output:
Input the number of Letters (less than 26) in the
Pyramid: 5
A
A B A
A B C B A
A B C D C B A
A B C D E D C B A
15. Write a C++ program to print a pyramid of digits as shown below for n
number of lines.
1
232
34543
4567654
567898765
Sample Output:
1
232
34543
4567654
567898765
16. Write a C++ program to print a pattern in which the highest number of
columns appears in the first row.
Sample Output:
Input the number of rows: 5
12345
2345
345
45
5
17. Write a C++ program that displays the pattern with the highest columns
in the first row and digits with the right justified digits.
Sample Output:
Input number of rows: 5
12345
1234
123
12
1
18. Write a C++ program to display the pattern using digits with left justified
spacing and the highest columns appearing in the first row in descending
order.
Sample Output:
Input number of rows: 5
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1
19. Write a C++ program to display the pattern like right angle triangle with
right justified digits.
Sample Output:
Input number of rows: 5
1
21
321
4321
54321
20. Write a program in C++ to display the pattern like pyramid, power of 2.
Sample Output:
21. Write a program in C++ to display such a pattern for n number of rows
using numbers. There will be odd numbers in each row. The first and last
number of each row will be 1 and the middle column will be the row
number. N numbers of columns will appear in the 1st row.
Sample Output:
Input number of rows: 7
1234567654321
12345654321
123454321
1234321
12321
121
1