Friday, 7 August 2015

Left Triangle pattern using stars

Leave a Comment
Questions:

Left Triangle pattern using stars

Code:

#include<iostream>
using namespace std;
void main()
{

//Left Triangle pattern using stars
int square,space=0;
cout<<"Enter The Size of Square = "; // size
cin>>square;
space=square;
for(int i=1;i<=square;i++)
{
for(int j=1;j<=space;j++)
{
cout<<" ";
}
for(int l=1;l<=i;l++)
{
cout<<"*";
}
cout<<endl;
space--;
}

}


Output

If You Enjoyed This, Take 5 Seconds To Share It