(a) (b) (c) (d)
* ********** ********** *
** ********* ********* **
*** ******** ******** ***
**** ******* ******* ****
***** ****** ****** *****
****** ***** ***** ******
******* **** **** *******
******** *** *** ********
********* ** ** *********
********** * * **********
I managed to do a and b, but I am stuck with c and d..Can someone help me, just perhaps describe the logic.. I will try it out myself.
#include<iostream.h>
#include<conio.h>
using namespace std;
int main()
{
clrscr();
int i,j;
cout<<"(a)";
cout<<"\n";
for(i=1;i<=10;i++)
{
for(j=1;j<=i;j++)
{
cout<<"*";
}
cout<<"\n";
}
cout<<"\n";
cout<<"(b)";
cout<<"\n";
for(i=10;i>0;i--)
{
for(j=i;j>0;j--)
{
cout<<"*";
}
cout<<"\n";
}
cout<<"\n";
cout<<"(c)";
cout<<"\n";
for(i=1;i<=10;i++)
{
cout<<" ";
for(i=2;i<=10;i++)
{
cout<<"*";
}
}
return 0;
}