How to write a c program to create a triangle of numbers in C Programming ?
Solution:
#include <stdio.h>
int main()
{
int n, i, j;
printf("Enter dimension: ");
scanf("%d", &n);
for(i = 1; i <= n; i++)
{
for(j = 1; j <= i; j++)
printf("%d ", j);
printf("\n");
}
return 0;
}