-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxyz.cpp
More file actions
48 lines (40 loc) · 795 Bytes
/
xyz.cpp
File metadata and controls
48 lines (40 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <iostream>
using namespace std;
int main()
{
int a = 2;
int b = 6;
cout << "a & b" << (a & b) << endl;
cout << "a|b" << (a | b) << endl;
cout << "~a" << ~a << endl;
cout << "a^b" << (a ^ b) << endl;
cout << (17 >> 1) << endl;
cout << (17 >> 2) << endl;
cout << (19 << 1) << endl;
cout << (21 << 2) << endl;
int i = 7;
cout<<++i<<endl; //8 i=8
cout<<i++<<endl; //8 i=9
cout<<i--<<endl; //9 i=8
cout<<--i<<endl; //7 i=7
a,b=1;
a=10;
if (++a)
{
cout<<b;
}
else
{
cout << ++b;
}
a=1,b=2;
if (a-->0 || ++b>2)
{
cout<<"stage1 - Inside if";
}
else
{
cout<<"stage2 - Inside else";
}
cout<<a<<" "<<b<<endl;
}