C++ Exercises: Display the pattern like a pyramid using number and a number will repeat for a row
41. Repeating Number Pyramid
Write a C++ program to make such a pattern, like a pyramid, with a repeating number.
Sample Solution:
C++ Code :
Sample Output:
Display such a pattern like a pyramid using number with repetition : ------------------------------------------------------------------------- Input number of rows: 5 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
Flowchart:

For more Practice: Solve these Related Problems:
- Write a C++ program to print a pyramid where each row displays the row number repeated row times, using nested loops.
- Write a C++ program to construct a pyramid pattern with numbers, ensuring that each row’s number appears exactly as many times as its row number.
- Write a C++ program that uses recursion to print a pyramid of repeating numbers for a given number of rows.
- Write a C++ program to print a right-aligned pyramid where the row number is repeated and the pyramid is padded with spaces on the left.
C++ Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a program in C++ to make such a pattern like a pyramid with an asterisk.
Next: Write a program in C++ to display the pattern like a pyramid using asterisk and each row contain an odd number of asterisks.
What is the difficulty level of this exercise?