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 49046ba commit 26c7db7Copy full SHA for 26c7db7
bitOperations.c
patterns/diamond.cpp
@@ -0,0 +1,22 @@
1
+#include <iostream>
2
+
3
+using namespace std;
4
5
+int main()
6
+{
7
+ int num;
8
+ cin >> num;
9
10
+ for(int i=1; i<=2*num; i++){
11
+ for(int j=1; j<2*num; j++){
12
+ if((j >= num-i+1) && (j<= num+i-1) && (num+j)>= i && j<=3*num-i)
13
+ cout << "* ";
14
15
+ else
16
+ cout << " ";
17
+ }
18
+ cout << endl;
19
20
21
+ return 0;
22
+}
0 commit comments