Hi i'm writing this program where the user chooses whether to print out a square, a forward triangle, and a backwards triangle using the "*" character. I got the square and the backwards triangle to work and the forward triangle, but i cant figure out how to do the back wards one.
*
**
***
**** is how the foward triangle looks when the user enters the size of 4 the backwards one should look like
*
**
***
**** when the user enters 4 for the size. my code for the normal triangle is below(for some reason this wont show up how its suppose to but it should look the same as the normal triangle just slanting to the left instead of to the right.)
cout << "enter the size of your triangle." << endl;
cin >> size;
for(line = 1;line <= size; line++)
{
stars = line;
for(loop = 1;loop <= stars;loop++)
{
cout << "*";
}
cout << endl;
}
If anyone could help me to print out the backwards triangle with just if -else statements and loops that would be great.