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
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
0 Questions:
Post a Comment