C++ Program to Print Pyramid Star Pattern

2 comments on “C++ Program to Print Pyramid Star Pattern”


  • Manmeet

    #include

    using namespace std;

    int main(){

    int row;
    cin >> row;

    for(int i = 1; i <= row; i++){

    for(int space = i; space < row; space++) cout << " ";
    for(int j = 1; j <= 2*i-1; j++) cout << "*";
    cout << endl;
    }

    return 0;