Help with printing a square..

I need to print this square:

1****
12***
123**
1234*
12345

But my output turned to:

*****
1****
12***
123**
1234*


Here's my code so far:

int main()
{
int count = 1, size, num;
cout<<"Enter Size: ";
cin>>size;
while( count <= size)
{
int count2 = 1;
num = 1;
while( count2 < count)
{
cout<<""<<num;
count2 = count2+1;
num++;
}
while( count2 < size)
{
cout<<"*";
count2 = count2+1 ;
}
cout <<"\n";
count = count + 1 ;
}
getch();
}

EDIT: I was told not to use the for loop yet.. :/
Last edited on
while( count < size)
Topic archived. No new replies allowed.