C Program to Print Half Pyramid of Numbers

In this program, you'll learn to print half pyramid of numbers.



Source Code
#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 ( );
}
Output
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5





"Coding Hub - Learn to code" app now available on Google Play Store