#include<iostream>
using namespace std;
int main()
{
int i, j, cnt;
cout<<"\n Enter Number of Rows : ";
cin>>cnt;
cout<<"\n";
for(i=0; i<cnt; i++)
{
for(j=cnt; j>i; j--)
{
cout<<" * ";
}
cout<<"\n";
}
return 0;
}
#include<iostream>
using namespace std;
int main()
{
int i, space, rows, k=0;
cout<<"\n Enter Number of Rows : ";
cin>>rows;
for(i=1; i<=rows; i++)
{
for(space=1; space<=(rows-i); space++)
{
cout<<" ";
}
while(k!=(2*i-1))
{
cout<<"* ";
k++;
}
k=0;
cout<<"\n";
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int rows, i, j, space;
cout<<"Enter Number of Rows : ";
cin>>rows;
cout<<"\n";
for(i=rows; i>=1; --i)
{
for(space=0; space<rows-i; ++space)
cout<<" ";
for(j=i; j<=2*i-1; ++j)
cout<<"* ";
for(j=0; j<i-1; ++j)
cout<<"* ";
cout<<endl;
}
return 0;
}