Code:
int i=1,j=1;

while(i<=5)  {
    printf("%i",i);
    i++;
    while(j<=i)  {
       printf("\n");
       j++;
}
but if i write like this, i compile cant get the correct output same as the for loop
1
22
333
4444
55555