C Program to print numeric pyramid-I

/* Pyramid triangle
1
12
123
1234
12345
*/

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

}

Output:


No comments:

Post a Comment

100 C Programs with Code and Output

Program 1: C Program To Read Two Numbers And Print The Sum Of Given Two Numbers. Program 2: C Program To Read Three Numbers And Prin...