c program to print given number pattern

Write a c program to print given number pattern
1
2 3
4 5 6
7 8 9 10
11 12 13 1 4 15

#include<stdio.h>
int main()
{
  int i,m,n;
  n=1;
  for(i=1;i<6;i++)
  {
    for(m=1;m<=i;m++)
    {
      printf("%d ",n++);
    }
    printf("\n");
  }
}

Related Posts