C++ Programming
C++ program to print Inverted triangle
#include<iostream>
using namespace std;
int main()
{
int rows,i,j;
cout<<"Enter Number of rows ";
cin>>rows;
cout<<endl;
for(i=rows-1;i>=1;i--)
{
for(j=rows-i;j>=1;j--)
{
cout<<" ";
}
for(j=1;j<=i;j++)
{
cout<<"* ";
}
cout<<endl;}
return 0;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment