I need to get an output like:
1 1
11 11
111 111
1111111
I tried a lot and came to the following program. But i'm getting output like:
1 1
11 11
111 111
1111111
Please help me correct this program. The preview of the shape was not coming properly so I attached a .txt file to the thread. Please refer to it for proper shape I need. Thanks!!
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
for(i=1;i<=4;i++)
{
if(i==4)
{
for(k=0;k<7;k++)
{
printf("1");
}break;
}
for(j=0;j<i;j++)
{
printf("1");
}
for(k=3;k>=i;k--)
{
printf(" ");
}
for(j=0;j<i;j++)
{
printf("1");
}
printf("\n");
}
getch();
}