Skip to content

Commit cac5344

Browse files
authored
pattern.cpp
A basic c++ program to print a simple triangular pattern
1 parent 3d25313 commit cac5344

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pattern.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include<iostream>
2+
using namespace std;
3+
4+
int main(){
5+
cout<<"Enter the number of rows"<<endl;
6+
int n;
7+
cin>>n;
8+
for(int i=1;i<=n;i++){
9+
for(int j=1;j<=i;j++){
10+
cout<<j<<" ";
11+
}
12+
cout<<endl;
13+
}
14+
return 0;
15+
}

0 commit comments

Comments
 (0)