Hello!
I am having a problem with my program.I have made a program that prints the four different shapes one after the other. But the program should print these four different shapes side by side.
I know there should be one outer loop for this but I am unable to change the program. Can any one help? I am really in need of it....
#include<iostream.h>
#include<conio.h>
void main()
{
int i, j, k;
cout<<"\ta\n"<<endl;
for(i=1;i<=10;i++)
{
for(j=1;j<=i;j++)
cout<<"*";
cout<<endl;
}
cout<<endl<<endl<<"\tb\n"<<endl;
for(i=10;i>=1;i--)
{
for(j=1;j<=i;j++)
cout<<"*";
cout<<endl;
}
cout<<endl<<endl<<"\tc\n"<<endl;
for(i=10;i>=1;i--)
{
for(k=1;k<=10-i;k++)
cout<<" ";
for(j=1;j<=i;j++)
cout<<"*";
cout<<endl;
}
cout<<endl<<endl<<"\td\n"<<endl;
for(i=1;i<=10;i++)
{
for(k=1;k<=10-i;k++)
cout<<" ";
for(j=1;j<=i;j++)
cout<<"*";
cout<<endl;
}
getch();
}