i'm trying to print out a triangular form of a set of numbers
should be printing out like this
1
22
333
4444
55555
666666
up to 9.
but i'm getting
111111111
222222222
333333333
up to 9
then i get a little 10 hanging on the end..
like so
888888888
999999999
10
here's my code..
main()
{
int n, col, row;
printf("Enter value n: ");
scanf("%d", &n);
while (n <= 9)
{
for(row=0; row<=9; row++)
{
/*for(col=n; col<=9; col++)
{
printf("%d", n);
}*/
printf("%d", n);
}
printf("\n");
n++;
}
printf("%d", n);
scanf("%d");
return 0;
}