Starting Vocational Training From 1-May-2024 Get Detail


Write a program in C to make such a pattern like right angle triangle with number increased by 1. 

The pattern like :

   1

   2 3

   4 5 6

   7 8 9 10


#include <stdio.h>
void main()
{
   int i,j,rows,k=1;
   printf("Input number of rows : ");
   scanf("%d",&rows);
   for(i=1;i<=rows;i++)
   {
    for(j=1;j<=i;j++)
       printf("%d ",k++);
    printf(" ");
   }
}