0
1 0
0 1 0
1 0 1 0
0 1 0 1 0
1 0 1 0 1 0
The output for the above program is:
The source code for the above program is:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
int main() | |
{ | |
int i,j; | |
for(i=1;i<=6;i++) | |
{ | |
for(j=1;j<=i;j++) | |
{ | |
if((i+j)%2==0) | |
{ | |
printf(" 0"); | |
} | |
else | |
{ | |
printf(" 1"); | |
} | |
} | |
printf("\n"); | |
} | |
} |
0 comments :
Post a Comment