Skip to content

Commit 49956e4

Browse files
Add files via upload
1 parent 2e8b6d1 commit 49956e4

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Diff for: bitwiseOperators.cpp

+31
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)