Answers for "inverted half pyramid in c++"

C++
0

inverted half pyramid in c++

#include <iostream>
using namespace std;
int main()
{
    int num;
    
    cout<< "Enter length of star pattern: ";
    cin >> num;

    for (int i=num; i>=1; i--)
    {
        for (int j = 0; j < i; j++)
        {
            cout<< "*";
        }
        cout << endl;
    }

    return 0;
}
Posted by: Guest on July-17-2021

Browse Popular Code Answers by Language