star pyramid pattern

Solutions on MaxInterview for star pyramid pattern by the best coders in the world

showing results for - "star pyramid pattern"
Lisandro
03 Jul 2018
1#include <iostream>
2using namespace std;
3
4int main()
5{
6    int rows;
7
8    cout << "Enter number of rows: ";
9    cin >> rows;
10
11    for(int i = 1; i <= rows; ++i)
12    {
13        for(int j = 1; j <= i; ++j)
14        {
15            cout << "* ";
16        }
17        cout << "\n";
18    }
19    return 0;
20}
21