#include <iostream>
using namespace std;
void triangle(int n)
{
    for (int i=0;i<n;i++)
    {
        for (int j=0;j<=i;j++)
        {
          cout<<" +";
;
        }
          cout<<endl;
    }
}
int main()
{
    cout<<"\n\t  TRIANGLE";
    int n;
    cout<<"\nEnter a no. of Lines to print:"<<endl;
    cin>>n;
    triangle(n);
    return 0;
}

Embed on website

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