Program : Number Pyramid in C Programming


Program :
#include<stdio.h>
#include<conio.h>
void main()
{
 int i,j;
 int num;
 clrscr();
 printf("\nEnter the number of Digits :");
 scanf("%d",&num);
 for(i=0;i<=num;i++)
 {
    for(j=0;j<i;j++)
        printf("%d ",i);
 printf("\n");
 }
getch();
}

Output :
Enter the number of Digits : 5
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

Bookmark & Share

2 comments

  1. Kushal // May 18, 2025  

    how to make a pyramid like this one??
    2
    2 4
    2 4 6
    2 4 6 8
    please help me out with this one ....... my email id is kushalparikh28oct@gmail.com....
    if any1 have the ans plz mail me

  2. Priteh Taral // May 18, 2025  

    #include
    #include
    void main()
    {
    int i,j,num=2;
    clrscr();
    for(i=0;i<4;i++)
    {
    num=2;
    for(j=0;j<=i;j++)
    {
    printf("%d\t",num);
    num = num+2;
    }
    printf("\n");
    }
    getch();
    }

Post a Comment

Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email

Followers