blob: de8fb470743270ab538074e8d82d6f0c7929da8d (
plain)
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
|
#include <iostream>
/*
*
* 4.27
*
*
*/
int main () {
uint32_t ul1 = 3;
uint32_t ul2 = 7;
// 00000011 (ul1)
// 00000111 (ul2)
/*
ul1 AND ul2:
00000011
ul1 OR ul2
00000111
*/
std::cout << (ul1 & ul2) << std::endl; // 3
std::cout << (ul1 | ul2) << std::endl; // 7
std::cout << (ul1 && ul2) << std::endl; // 1 (true)
std::cout << (ul1 || ul2) << std::endl; // 1 (true)
return 0;
}
|