# Program in C++ to make such a pattern like a pyramid with a number that will repeat the number in the same row.

Write a program in C++ to make such a pattern like a pyramid with a number that will repeat the number in the same row.

Output

## Excercise

Find the possible mistakes in the following Shamil’s Flow Table of the Program to make such a pattern like a pyramid with a number that will repeat the number in the same row.

 What statement will be executed? Loop(r)=1, Loop(sp)=11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18output?– Loop(r)=1, Loop(sp)=21,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, 13,14,15,16,17,18 output?— Loop(r)=1, Loop(sp)=31,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,13,14,15,16,17,18, 13,14,15,16,17,18output?— Loop(r)=1, Loop(sp)=4, Loop(disp)=11,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, 13,14,15,16,17,18,13,14,15,16,17,1819,20,21,22,23,24,25,26output?—1 Loop(r)=1, Loop(sp)=4, Loop(disp)=21,2,3,4,5,6,7,8,9,10,11,12,(13,14,15,16,17,18,)^3,19,20,21,22,23,24,25,26,27,28,29,30output?Move to Next line Loop(r)=2, Loop(sp)=11,2,3,4,5,6,7,8,9,10,11,12,(13,14,15,16,17,18)^3,19,20,21,22,23,24,25,26,27,28,29,30,10,11,12,13,14,15,16,17,18output?– Loop(r)=2, Loop(sp)=2,1,2,3,4,5,6,7,8,9,10,11,12,(13,14,15,16,17,18)^3,19,20,21,22,23,24,25,26,27,28,29,30,10,11,12,13,14,15,16,17,18,10,11,12,13,14,15,16,17,18output?— Loop(r)=2, Loop(sp)=3, Loop(disp)=11,2,3,4,5,6,7,8,9,10,11,12,(13,14,15,16,17,18)^3,19,20,21,22,23,24,25, 26,27,28,29,30,(10,11,12,13,14,15,16,17,18)^2,19,20,21,22,23,24,25,26output?–2 Loop(r)=2, Loop(sp)=3, Loop(disp)=21,2,3,4,5,6,7,8,9,10,11,12,(13,14,15,16,17,18)^3,19,20,21,22,23,24,25,26,27,28,29,30,(10,11,12,13,14,15,16,17,18)^2,19,20,21,22,23,24,25,26,21,22,23,24,25,26output?–2-2 Loop(r)=2, Loop(sp)=3, Loop(disp)=31,2,3,4,5,6,7,8,9,10,11,12,(13,14,15,16,17,18)^3,19,20,21,22,23,24,25,26,27,28,29,30,(10,11,12,13,14,15,16,17,18)^2,19,20,(21,22,23,24,25,26)^2,27,28,29,output?Move to Next line Loop(r)=3, Loop(sp)=11,2,3,4,5,6,7,8,9,10,11,12,(13,14,15,16,17,18)^3,19,20,21,22,23,24,25,26,27,28,29,30,(10,11,12,13,14,15,16,17,18)^2,19,20,(21,22,23,24,25,26)^2,27,28,29,30,10,11,12,13,14,15,16,17,18output?– Loop(r)=3, Loop(sp)=2, Loop(disp)=11,2,3,4,5,6,7,8,9,10,11,12,(13,14,15,16,17,18)^3,19,20,21,22,23,24,25,26,27,28,29,30(10,11,12,13,14,15,16,17,18)^2,19,20,(21,22,23,24,25,26)^2,27,28,29,30,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26output?-3 Loop(r)=3, Loop(sp)=2, Loop(disp)=21,2,3,4,5,6,7,8,9,10,11,12,(13,14,15,16,17,18)^3,19,20,21,22,23,24,25,26,27,28,29,30(10,11,12,13,14,15,16,17,18)^2,19,20,(21,22,23,24,25,26)^2,27,28,29,30,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,21,22,23,24,25,26output?-3-3 Loop(r)=3, Loop(sp)=2, Loop(disp)=31,2,3,4,5,6,7,8,9,10,11,12,(13,14,15,16,17,18)^3,19,20,21,22,23,24,25,26,27,28,29,30,(10,11,12,13,14,15,16,17,18)^2,19,20,(21,22,23,24,25,26)^2,27,28,29,30,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,21,22,23,24,25,26,21,22,23,24,25,26output?-3-3-3 Loop(r)=3, Loop(sp)=2, Loop(disp)=41,2,3,4,5,6,7,8,9,10,11,12,(13,14,15,16,17,18)^3,19,20,21,22,23,24,25,26,27,28,29,30.(10,11,12,13,14,15,16,17,18)^2,19,20,(21,22,23,24,25,26)^2,27,28,29,30,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,21,22,23,24,25,26,21,22,23,24,25,26,27,28,29,30,31