recent

program to print given number pattern

Write a c program to print given number pattern
1
10
101
1010
10101
101010
1010101

#include<stdio.h>
int main()
{
  int i,j;
  for(i=1;i<=7;i++)
  {
    for(j=1;j<=i;j++)
    {
      printf("%d",j%2);
    }
    printf("\n");
  }
}
Powered by Blogger.