Code : Inverted Number Pattern
Code : Inverted Number Pattern
Send Feedback
Code : Inverted Number Pattern
4444
333
22
1
Integer N (Total no. of rows)
Pattern in N lines
0 <= N <= 50
5
55555
4444
333
22
1
6
666666
55555
4444
333
22
1
#include<iostream>using namespace std;
int main(){ int row=1; int n; cin>>n; while(n>=row){ int col=1; while(n-row+1>=col){ cout<<n-row+1; col++; } cout<<endl; row++; }
/* Read input as specified in the question. * Print output as specified in the question. */ }
Comments
Post a Comment