#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int i,j,k,n;
printf("Enter
line number:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{if(i%2!=0)
{for(j=1;j<=i;j++)
{ if(j%2==0)
{ printf("
0");}
else
{printf("
1");}}}
else if(i%2==0)
{for(j=1;j<=i;j++)
{ if(j%2==0)
{ printf("
1");}
else
{printf("
0");}}}
printf("\n");}
getch();
}
No comments:
Post a Comment
Please comment bellow. Share your knowledge