Pattern 3
user_6679955
c_cpp
2 months ago
146 B
4
Indexable
void nTriangle(int n) { for(int i=0; i<n; i++){ for (int j=0; j<=i; j++){ cout<< j+1<<" "; } cout<< endl; } }
Editor is loading...
Leave a Comment
void nTriangle(int n) { for(int i=0; i<n; i++){ for (int j=0; j<=i; j++){ cout<< j+1<<" "; } cout<< endl; } }