recent

c program to print given number pattern

Write a c program to print given number pattern
1
1 2 3
1 2 3 4 5
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9


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