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