Numeric Loop_1.6

#include <stdio.h>
int main (void)
{
    int i,j,k;
    for(i=0,k=1;i<=8;i+=2)
    {
       for(j=1;j<=6-k;j++)
       printf(".");
       for(j=1;j<=k+k-1;j++)
       printf("%d",i);
       printf("\n");
       k++;
    }
    system("pause");
    return 0;
}


The Output is Given Below:
.....0
....222
...44444
..6666666
.888888888

0 comments:

Post a Comment