Skip to content

Commit 4f0ef36

Browse files
Create CROSS_STAR_PATTERN.cpp
This will create a cross pattern using star
1 parent 2e8b6d1 commit 4f0ef36

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

C++/CROSS_STAR_PATTERN.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
6+
int size = 5;
7+
8+
for (int i = 0; i < size; i++) {
9+
for (int j = 0; j < size; j++) {
10+
if (i==j || i+j==size-1) {
11+
cout << "*";
12+
} else {
13+
cout << " ";
14+
}
15+
}
16+
cout <<endl;
17+
}
18+
return 0;
19+
}

0 commit comments

Comments
 (0)