Print pattern shown below
1
10
101
1010
CODE:
#include<stdio.h>
#include<conio.h>
void main()
#include<conio.h>
void main()
{int i,j;clrscr();for(i=1;i<=5;i++){for(j=i;j>=1;j--){printf("%d",j%2);}printf("\n");}getch();}
No comments:
Post a Comment