0
What is the output of this code?
#include <iostream> int main() { std::cout << (1 << 1 << 1); return 0; }
2 Answers
+ 3
solve the expression from right to left
0001 << 0001 = 0010 = 2
0001 << 2 = 0100 = 4
+ 1
4
#include <iostream> int main() { std::cout << (1 << 1 << 1); return 0; }