#include<iostream>#include<iomanip>using namespace std;void Pattern1(int n){ int i, j, k, x=1; for(i=1;i<=n;i++) { for(j=1;j<=n-i;j++) { cout<<" "; } for(k=1;k<=i;k++) { cout<<setw(3)<<x++; } cout<<endl; }}int main(){ int n; cout<<"Enter N: "; cin>>n; Pattern1(n);}
No comments
Post your comments