How to Program to display Pyramid in C++ Programming ?
![]() |
Program to display Pyramid in C++ |
/*
Program to display the following pattern:
1
212
32123
4321234
543212345
*/
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
for(int i=1;i<=5;i++)
{
for(int j=4;j>=i;j--)
cout<<" ";
for(int k=i;k>=1;k--)
cout<<k;
for(int l=2;l<=i;l++)
cout<<l;
cout<<endl;
}
getch();
}
This Program to display Pyramid in C++.
Learn More :
Pattern
- Program to display the following pattern: 1 12 123 1234 12345
- Program to display the following pattern: * ** *** **** *****
- Program to display the following pattern: ********** ********** **********
- Program to display the following pattern: * *** ***** ******* *********
- Program to display the following pattern: 1 222 33333 4444444 555555555
Display
- C++ Program to display the sum of this series: 1+1/2+1/3....1/n.
- C++ Program to enter an amount and display no. of Rs.500,100,50,20,10,5,1 notes.
- C++ Program to enter 'n' numbers and display no. of odd, even and numbers entered till user wishes.
- C++ Program to display prime numbers upto n.
- C++ Program to display first n terms of fibonacci series.
- C++ Program to display a number's digits reversed.
- C++ Program to display the sum of a number's digits.
- Program to display the following pattern: 1 12 123 1234 12345
- Program to display the following pattern: * ** *** **** *****
- Program to display the following pattern: ********** ********** **********
- Program to display the following pattern: * *** ***** ******* *********
- Program to display the following pattern: 1 222 33333 4444444 555555555
- Read Content From a Text File then Count and Display the Number of Alphabets
- C++ Program to display factorial of a number.