Triangle angle triangle pattern
You must aware of basic concept of loop.
#include <iostream>
using namespace std;
int main() {
int a,b,row;
cout<<"Enter number of row"<<endl;
cin>>row;
for(a=row;a>0;a--){
for(b=a;b>=1;b--){
cout<<b;
}
cout<<endl;
}
for(a=2;a<=row;a++){
for(b=a;b>=1;b--){
cout<<b;
}
cout<<endl;
}
return 0;
}
using namespace std;
int main() {
int a,b,row;
cout<<"Enter number of row"<<endl;
cin>>row;
for(a=row;a>0;a--){
for(b=a;b>=1;b--){
cout<<b;
}
cout<<endl;
}
for(a=2;a<=row;a++){
for(b=a;b>=1;b--){
cout<<b;
}
cout<<endl;
}
return 0;
}
Very nice
ReplyDeleteAmazing, please post more such pattern
ReplyDelete