C Program To Display The Number In A Specific Formats

How to write a C Program to display the number in a specific formats in C Programming Language ?


Solution For C Program :

/*C Program To Display The Number In A Specific Formats*/

#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 :

C Program To Swap Two Numbers Without Using Third Variable


Learn More :