PROGRAM
//Program to print a pattern of left right angled triangle
# include<iostream>
using namespace std;
int main()
{
int i,j,n;
cout<<"ENTER THE NUMBER OF ROWS: \n";
cin>>n;
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
if(j<=i)
cout<<"*";
else
cout<<" ";
}
cout<<endl;
}
return 0;
}
OUTPUT
//Program to print a pattern of left right angled triangle
# include<iostream>
using namespace std;
int main()
{
int i,j,n;
cout<<"ENTER THE NUMBER OF ROWS: \n";
cin>>n;
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
if(j<=i)
cout<<"*";
else
cout<<" ";
}
cout<<endl;
}
return 0;
}
OUTPUT