Jan 27, 2007

C++ Program to print pyramid of stars

C++ program to print pyramid of stars.
*
* *
* * *
* * * *
* * * * *

main()
{
clrscr();
int i,k;
for (i=1;i<=5;i++)
{
for (k=1;k<=i;k++)
{
cout<<"*";
}
cout<<endl;
}
getch();
}

No comments:

Post a Comment

Infolinks In Text Ads

Total Pageviews

Powered by Blogger.

Dont Forget To Follow Us

Blog Archive