Saturday, 17 November 2012

Pattern Print Code


*****
****
***
**
*

#include <iostream>
#include <math.h>
using namespace std;
int main()
{
for (int i=5;i>=1;i--)
{
for(int j=1;j<=5-i;j++)
cout <<" ";
for (int k=1;k<=i;k++)
cout <<"*";
cout<<endl;
}
return 0;
}

No comments:

Post a Comment