#include <iostream>
using namespace std;

int main() {
    cout << "Enter a Number(Row) : ";
    int n;
    cin >> n;
    cout << endl;
    
    int row = 1;
    int counting = 1;
    
    while(row <= n){
        int col = 1;
        while( col <= row){
            cout << counting << " ";
            counting += 1;
            col += 1;
        }
        cout << endl;
        counting -= 1;
        row += 1;
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: