Print the following pattern
Pattern for N = 4
Input Format :
N (Total no. of rows)
Output Format :
Pattern in N lines
Sample Input 1 :
3
Sample Output 1 :
1
23
345
code:
#include<iostream>
using namespace std;
int main(){
int n , k=1;
cin >> n;
for(int i=1;i<=n;i++)
{
for (int j=1 ; j<=i;j++)
{
cout << i+j-1;
}
cout << endl;
}
}
Milan Tomic

0 comments:
Post a Comment