In this program, you'll learn to print half pyramid of numbers.
#include <stdio.h>
#include <conio.h>
void main()
{
int i,j;
for (i=0; i<5; i++)
{
for (j=0; j<=i; j++)
{
printf("%d ", j+1);
}
printf("\n");
}
getch ( );
}
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5