my code is working but I cannot make it function the right way, my program should display the following pattern, given the value of n and m. example if n=5, and m=6,
the output should be:
*****
*___*
*___*
*___*
*___*
*****
but my wrong code outputs this:
*****
*
*
*
*
*
*
*
*
*
*
*
*
******
please help me to correct my code,
this is my wrong code
#include <iostream.h>
#include <conio.h>
int main()
{
int m,n,o;
cout<<"entr #";
cin>>n;
cout<<"entr #";
cin>>m;
for (n=1;n<=m;++n)
{cout<<"*";
}
for (m=2;m<=n;++m)
{
cout<<"\n";
cout<<"*";
}
for (n=2;n<=m;++n)
{cout<<"\n";
cout<<"*";}
for (m=3;m<=n;++m)
{cout<<"*";
}
getch();
}
please help me, thanks in advance.