I can not remember how to do this for anything.
I need to make a pyramid look like this using a while loop
*
**
***
****
*****
******
*******
********
*********
**********
I can do it using a for loop, but when I do a while all I get is the first row the ten rows and just one column. any help?
#include<stdio.h>
#include <iostream>
int main (void)
{
int row,col;
int num;
num=10;
row=0;
col=0;
while(row<=num)
{
row++;
while(col<row)
col++;
printf("* ");
printf("\n");
}
system("PAUSE");
return 0;
}