Pyramid in C++
#include<conio.h>
main()
{
int a,b,i,temp;
cout<<"Enter the level of pyramid:";
cin>>a;
temp=a;
for(i=1;i<=a;i++)
{
for(b=1;b<=temp;b++)
cout<<" ";
temp--;
for(b=1;b<=2*i-1;b++)
cout<<"*";
cout<<endl;
}
getch();
}
Output
The blog consist sources of object oriented languages.Such as concepts of c++,java,C# .Blog enhances your programming skills from your first step to a known developer.
No comments:
Post a Comment