Write a program in C++ to print Floyd’s Triangle.

Write a program in C++ to print Floyd’s Triangle.

Flowchart of the program in C++ to print Floyd’s Triangle

Flowchart of the program in C++ to print Floyd's Triangle.

C++ code of the program to print Floyd’s Triangle.

Output

Please Enter No of Rows: 5

1

01

101

0101

10101

Excercise

Find the possible mistakes in the following Shamil’s Flow Table  of the program in C++ to print Floyd’s Triangle

Value of n Loop 1 If(i%2==0)

 

Loop 2 If(j%2==0)

 

Which line will execute
1 I=1 f J=1 f 1,2,3,4,5,6,7,8,9,10,11,16,17,18,19,20,21,22,

23,24,26,27,28,29,30,31,32,33,34,35

2 I=2 T J=2 T 1,2,3,4,5,6,7,8,9,10,11,16,17,18,19,20,21,22,

23,24,26,27,28,29,30,31,32,33,34,9,10,11,12,

13,14,15,21,22,23,24, 26,27,28,29,30,22,23,24,25, 28,29,30,31,32,33,34,35

3 I=3 F J=3 F 1,2,3,4,5,6,7,8,9,10,11,16,17,18,19,20,21,22,

23,24,26,27,28,29,30,31,32,33,34,   9,10,11,

12,13,14,15,21,22,23,24, 26,27,28,29,30,22,

23,24,25, 28,29,30,31,32,33,34,    9,10,11,16,17,18,19,20,21,22,23,24,26,27,28,

29,30,22,23,24,25,28,29,30,22,23,24,26,28,29

,30,31,32,33,34,35

 

Latest posts by Prof. Fazal Rehman Shamil (see all)

Buy advertisement space on T4Tutorials

For more details email [email protected]