Jan 31, 2007

C++ Program to print upside down pyramid of stars

C++ program to print pyramid of stars (Upside down)
* * * * *
* * * *
* * *
* *
*

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

No comments:

Post a Comment