11111
0000
111
00
1
#include <stdio.h>
int main()
{
int i, j;
for(i=5;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("%d",i%2);
}
printf("\n");
}
return 0;
}
Related Links:
- More Number Pattern Programs
- Star Pattern Programs in C
- Alphabet Pattern Programs in C
- Series Programs in C
ENTER THE VALUE AND GOT THE RESULT..
ReplyDelete#include
int main()
{
int count=0,n,i,j;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=n;j>=i;j--)
{
if(i%2==0)
printf("0");
else
printf("1");
}
printf("\n");
}
}
#include
ReplyDeleteint main()
{
int r,i,j;
printf("Enter the no. of rows : ");
scanf("%d",&r);
for(i=r;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("%d",i%2);
}
printf("\n");
}
return 0;
}