+ 2

Write program by c++ to print this pattern like number triangle

the out put is 1 2 3 4 5 6 7 8 9 10

29th Apr 2017, 12:47 PM
Zeyad Sharo
Zeyad Sharo - avatar
2 Answers
+ 8
int x=1; for(int i=1;i<=n;i++) //no. Of steps { for(int j=1;j<=i;j++) cout<<x++; cout<<endl; }
29th Apr 2017, 1:28 PM
Hariharasubramanian
+ 1
thanks for answering
29th Apr 2017, 2:13 PM
Zeyad Sharo
Zeyad Sharo - avatar