Program to print half pyramid using @ in C++ - Part 9




#include <iostream>
using namespace std;

int main()
{
    int rows;

    cout << "Enter number of rows: ";
    cin >> rows;

    for(int i = 1; i <= rows; ++i)
    {
        for(int j = 1; j <= i; ++j)
        {
            cout << "* ";
        }
        cout << "\n";
    }
    return 0;
}
Program to print half pyramid using @ in C++ - Part 9 Program to print half pyramid using @ in C++ - Part 9 Reviewed by Viththiyakaran on 11:52 PM Rating: 5

No comments:

Powered by Blogger.