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.
Search This Blog
Sunday, 15 September 2013
Print Pyramid through C++
Pyramid in C++
#include<iostream.h> #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(); }
No comments:
Post a Comment