pyramid

i dont know how to make a pyramid of stars.....
*
***
*****
Last edited on
It's easy.
U jst have to use a nested for-loop structure for this(one for rows other for columns) :
for(int r=1;r<x;r++) //x is size of triangle
{ for(int c=0;c<r;c++)
cout<<"*";
cout<<endl;
}

Last edited on
Topic archived. No new replies allowed.