C++ Program to print a pattern of right angled triangle [DEVCPP/GCC]

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

C++ Program to print a pattern of right angled triangle with output

Share this

Related Posts

FIND US ON FACEBOOK!