Triangle angle triangle pattern
You must aware of basic concept of loop.
#include <iostream>
using namespace std;
int main() {
int a,b,s,row;
cout<<"Enter number of row"<<endl;
cin>>row;
for(a=1;a<=row;a++){
for(s=a;s<=row;s++){
cout<<" ";
}
for(b=a;b>=1;b--){
cout<<"*";
}
cout<<endl;
}
return 0;
}
No comments:
Post a Comment