We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e8b6d1 commit 49956e4Copy full SHA for 49956e4
bitwiseOperators.cpp
@@ -0,0 +1,31 @@
1
+#include<iostream>
2
+using namespace std;
3
+
4
5
+int main() {
6
7
+ int a = 4;
8
+ int b = 6;
9
10
+ cout<<" a&b " << (a&b) << endl;
11
+ cout<<" a|b " << (a|b) << endl;
12
+ cout<<" ~a " << ~a << endl;
13
+ cout<<" a^b " << (a^b) << endl;
14
15
+ cout<< (17>>1)<<endl;
16
+ cout<< (17>>2) <<endl;
17
+ cout<< (19<<1) <<endl;
18
+ cout<< (21<<2) <<endl;
19
20
+ int i = 7;
21
22
+ cout<< (++i) <<endl;
23
+ // 8
24
+ cout<< (i++) <<endl;
25
+ // 8 , i = 9
26
+ cout<< (i--) <<endl;
27
+ //9 , i = 8
28
+ cout<< (--i) <<endl;
29
+ // 7, i =7
30
+ return 0;
31
+}
0 commit comments