C++ Program right angle triangle with a number that will repeat a number in a row

Write a program in C++ to make such a pattern like the right angle triangle with a number that will repeat a number in a row.

Flowchart of the right-angle triangle Program

Flowchart of the right-angle triangle C++ Program

C++ Program (Source Code) of the right-angle triangle Program

Output

Please Enter No. of Rows: 4

1

22

33

44

Excercise

Find the possible mistakes in the following Shamil’s Flow Table of the program of the right-angle triangle.

Suppose user input num = 3

Loop i Loop J What line will Execute Actual work to do
1 time

i = 1

1 time

j = 1

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17

18, 19, 20, 21, 22

coot<<i;

i =1

1

2 time

i=2

2 time

j=2

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17

 

18, 19, 20, 21, 9, 10, 11, 12, (13,14,15,16,17)2,18,

19,20,21,22,

coot<<i;

i =2

22

2 time

i=3

2 time

j=3

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17

 

18, 19, 20, 21, 9, 10, 11, 12, (13,14,15,16,17)2,18,

 

19,20,21,22,21,9,10,11,12,(13,14,15,16,17)3,18,

19,20,21,22,

coot<<i;

i =3

333

 

Add a Comment