Ok I have this problem.
First I need to make a right triangle:
#
##
###
Done.
Then I need to make an opposite right triangle:
- #
-##
###
(I hope you know what I mean. Not any isosceles triangle, just the same triangle but the opposite.)
Not done.
Here is the code I used for the first one:
Code:
for (int row = 0; row < 10; row++)
{
for (int col = 0; col <= row; col++)
{
cout << "#";
}
cout << "\n";
}
For the second one my code was this, but the problem is that I can't use the int count = row - 2, and the if statement that goes along with it. I can only use another for loop.
Code:
for (int row = 0; row > 3; row++)
{
int count = row - 2;
for (int col = 0; col > 3; col++)
{
count ++;
if ( count - 1 == 0 )
{
cout << "#";
}
else {cout << " ";}
}
cout << "\n";
}
Can anyone help me with this? I need another for loop added to the original code for the first right triangle.