Asterisk Triangle

Hi there, this code outputs an asterisk triangle with a straight edge down the left, I cant for the life of me figure out how to reverse it so that the straight line is down the right! Any advice is welcome :)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  #include <iostream>
using namespace std;
int main()
{
    int i, j, rows=5;
        for (i = 1; i <= rows; ++i)
    {
        for (j = 1; j <= i; ++j)
		{
            cout << "*";
        }


        cout << "\n";
}
        system("pause");
    return 0;
}
Hint: The output becomes a rectangle with some characters as spaces and some asterisks.
Topic archived. No new replies allowed.