Trying to get an outcome that looks like this..
#
?#
??#
?#
#
What I'm getting is this...
#
?#
?#?#
compiles ok, but as you can see it places the # after each ? rather than grouping them together, and it neglects to count back down.
Don't want to have my homework done for me, just want an idea where to look for the trouble. head spinning.
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
char bend = '#';//#@ beginning and end
char cues = '?';
int n,x,y ;
cout <<"Please enter number of ?'s :";
cin >> n;
cout<< bend<< endl;
for(y=1;y<=n;y++)
{
for(x=1;x<=y;x++)
{
cout<< cues <<bend;
}
cout<< endl;
}
for(y=1;y>=n;y--)
{
for(x=1;x>=y;x--)
{
cout<< cues << bend;
}
cout<< bend << endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}
any help would be greatly appreciated