Program Code:

#include<stdio.h>
int main()
{
   int i, j;
   int count = 1;
   for (i = 1; i <= 5; i++)
    {
      for (j = 0; j < i; j++)
      {
         printf("%d\t", count);
         count++;
      }
        printf("\n");
    }
   return 0;
}

Output:

1
2       3
4       5       6
7       8       9       10
11      12      13      14     15

Leave a Reply

Your email address will not be published. Required fields are marked *