Print the following design:
1
01
101
0101
#include<stdio.h>
#include<conio.h>
main()
{
int i,j;
clrscr();
for(i=1;i<=4;i++)
{
for(j=1;j<=i;j++)
{
if((i+j)%2==0)
printf("1");
else
printf("0");
}
printf("\n");
}
return 0;
}
1
01
101
0101
#include<stdio.h>
#include<conio.h>
main()
{
int i,j;
clrscr();
for(i=1;i<=4;i++)
{
for(j=1;j<=i;j++)
{
if((i+j)%2==0)
printf("1");
else
printf("0");
}
printf("\n");
}
return 0;
}