Code:
#include<iostream>
#include<conio.h>
#include<iomanip>
using std::cout;
using std::cin;
using std::endl;
using std::setw;
int main()
{
// declare & initialize variable/s
int x,y,z,c;
// print astericks
for(x=1;x<=11;x++)
{
cout<<'*';
for(y=x-1;y<=9;y++)
cout<<'*';cout<<endl;
}
cout<<"\n";
for(x=0;x<=11;x++)
{
cout<<'*';
for(y-=x;y<=9;y++)
cout<<'*';cout<<endl;
}
cout<<"\n";
for(x=1;x<=11;x++)
{
cout<<'*';
for(y=1;y<=9;y++)
cout<<'*';cout<<endl;cout<<setw(2);
}
getch();
}
The last for loop doesn't work if I have to print the following
*********
********
*******
******
*****
****
***
**
*
should it be
( print one whole row of * and print the next row after leaving first *)?