Pyramid Using C++ Programming Language

Pyramid: A shape whose outer surfaces are triangular and converge into a point called Pyramid.

To make a pyramid using C++ Programming language is easy.First you have to think what will you use for making pyramid means either using multiplication sign or letters or numbers.Let i will go for multiplication sign.Lets start our program,



Program code:

#include<iostream>                            
#include<conio.h>
using namespace std;
int main()
{
 int b=10;

 for (int a=1;a<=10;a++)
{
for ( int c=1; c <= b ; c++ )
cout<<" ";

for ( int x = 1 ; x <= a ; x++)
{
cout<< "*" ;
cout<< " " ;

}
cout<< "\n" ;
b--;
}
getch();
}

Output: After compiling and executing , the result is as follows



Hope that you will find this helpful.

1 comment:

  1. Here is a list of C star pattern programs to print star triangle and pyramid patterns c programs.

    ReplyDelete

Please disable your ad blocker to support this website.

Our website relies on revenue from ads to keep providing free content.