Ok, i've been workin on this quite some time. I am literally standing at the doorway waiting for door to be unlocked. I almost have it but am missing something. Here is what I have:
Code:
#include <iostream>
#include <iomanip>
using namespace std;
void pattern ()
{
char ch;
int column;
cout << "enter character";
cin >> ch;
cout << "enter # of lines";
cin >> column;
for (int i=column; i> 1; --i)
{
cout << " " << setw(i-1);
for (int j=1; j<column; ++j)
cout << ch;
cout << endl;
}
}
int main ()
{
pattern ();
return 0;
}
This program gives me the following output:
enter lines: 5
enter character: *
____****
___****
__****
_****
(^^ignore the _'s again^^)
Can someone point me in the direction of where to look at to see whats causing this problem. I believe I'm correct, but should the for statements go the other way around? Are the increments I'm doing right? Please help as much as you are able to
thanks
-steve