#include <iostream>
using namespace std;


int main() {
    int height = 5;


    // Menggambar segitiga
    for (int i = 1; i <= height; i++) {
        // Menampilkan spasi untuk membentuk segitiga
        for (int j = i; j < height; j++) {
            cout << " ";
        }
        // Menampilkan bintang
        for (int j = 1; j <= (2 * i - 1); j++) {
            cout << "*";
        }
        cout << endl;
    }


    return 0;
}

Embed on website

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