Nested Loops

I need help on writing this
**********
*********
********
*******
******
*****
****
***
**
*
I figured how to do it the other way going down
with this
int main ()
{
for (row=1; row <=10 ; row++)
{
for (col=1; row>=col; col++)
{
cout << "*" ;
}
cout << endl ;
}
}
please help, thank you :)
1
2
3
4
5
6
7
8
9
10
11
int main ()
{
  for (row=1; row <=10 ; row++)
  {
     for (col=1; 11 - row>=col; col++)
     {
         cout << "*" ; 
      }
      cout << endl ;
   }
}
Last edited on
Topic archived. No new replies allowed.