Skip to content

Commit 675e9d5

Browse files
authored
Merge pull request #126 from Aadya25416/starpattern
added a file inside pattern folder
2 parents b613b79 + 17e4480 commit 675e9d5

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

CPP/pattern/star_pattern.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// This is the code for simple star pattern printing with n rows and m columns.//
2+
#include <bits/stdc++.h>
3+
using namespace std;
4+
int main()
5+
{
6+
int n;
7+
// n is the number of rows//
8+
cout << "Enter number of rows:";
9+
cin >> n;
10+
//user will input the value of n//
11+
12+
int m;
13+
//m is the number of columns//
14+
cout << "Enter number of columns:";
15+
cin >> m;
16+
//user will input the value of m//
17+
18+
for (int i = 1; i <= n; i++)
19+
{
20+
for (int j = 1; j <= m; j++)
21+
{
22+
cout << "*";
23+
}
24+
cout << endl;
25+
//It is used for changing line once the second for loop is over//
26+
}
27+
}

0 commit comments

Comments
 (0)