File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ #include < bits/stdc++.h>
2+ using namespace std ;
3+
4+ void pattern4 (int n){
5+ for (int i = 1 ; i <= n; i++){
6+ for (int j = 1 ; j <= i; j++){
7+ cout << i << " " ;
8+ }
9+ cout << endl;
10+ }
11+ }
12+
13+ int main (){
14+ pattern4 (5 );
15+ return 0 ;
16+ }
Original file line number Diff line number Diff line change 1+ #include < bits/stdc++.h>
2+ using namespace std ;
3+
4+ void pattern5 (int n){
5+ for (int i = 0 ; i < n; i++){
6+ for (int j = 0 ; j < n - i; j++){
7+ cout << " *" ;
8+ }
9+ cout << endl;
10+ }
11+ }
12+
13+ int main (){
14+ pattern5 (5 );
15+ return 0 ;
16+ }
Original file line number Diff line number Diff line change 1+ #include < bits/stdc++.h>
2+ using namespace std ;
3+
4+ void pattern6 (int n){
5+ for (int i = 1 ; i <= n; i++){
6+ for (int j = 1 ; j <= n - i + 1 ; j++){
7+ cout << j;
8+ }
9+ cout << endl;
10+ }
11+ }
12+
13+ int main (){
14+ pattern6 (5 );
15+ return 0 ;
16+ }
You can’t perform that action at this time.
0 commit comments