Code: Mirror Number Pattern
Code: Mirror Number Pattern
Send Feedback
Code: Mirror Number Pattern
Integer N (Total no. of rows)
Pattern in N lines
0 <= N <= 50
3
1
12
123
4
1
12
123
1234
#include<iostream>using namespace std;
int main(){ int row=1; int n; cin>>n; while(n>=row){ int space=1; while(n-row>=space){ cout<<" "; space++; } int number=1; while(row>=number){ cout<<number; number++; } cout<<endl; row++; }
/* Read input as specified in the question. * Print output as specified in the question. */ }
Comments
Post a Comment