We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 447c348 commit 6383ad0Copy full SHA for 6383ad0
A_alphabat.cpp
@@ -0,0 +1,20 @@
1
+#include <iostream>
2
+using namespace std;
3
+
4
+int main() {
5
+ int n = 6; // Height of the pattern
6
7
+ for (int i = 0; i < n; i++) {
8
+ for (int j = 0; j <= n; j++) {
9
+ // Print * at required positions
10
+ if ((j == n - i) || (j == n + i) || (i == n / 2 && j > n - i && j < n + i)) {
11
+ cout << "*";
12
+ } else {
13
+ cout << " ";
14
+ }
15
16
+ cout << endl;
17
18
19
+ return 0;
20
+}
0 commit comments