How to write a C Program to display the number in a specific formats in C Programming Language ?
Solution For C Program :
#include<stdio.h>
void main()
{
int r, s, n, key;
printf("\nEnter the Value of n : ");
scanf("%d", &n);
key = 1;
for(r = 1; r <= n; r++)
{
for(s = 1; s <= r; s++)
printf("%3d", key++);
printf("\n");
}
}
You may also learn these C Program/Code :