Monday, 6 February 2017

Right angle Triangle Pattern in C++

#include<iostream>
using namespace std;


int main()
{
int num;
cout << "Enter the number of lines: " << endl;
cin >> num;
for(int x=0; x<num; ++x){
                        for(int y=0; y<x; ++y){
                               cout << "*";
                            }
        cout << endl;
}

return 0;

}

No comments:

Post a Comment