hexadecimal or binary to int c 2b 2b

Solutions on MaxInterview for hexadecimal or binary to int c 2b 2b by the best coders in the world

showing results for - "hexadecimal or binary to int c 2b 2b"
Lavana
10 Sep 2020
1   int number{};
2
3    number = 15; //integer literal
4    std::cout << number << std::endl;
5    number = 0x0F; // 0x - and then you type your value {0F} in hexadecimal
6    std::cout << number << std::endl;
7    number = 0b1111; // 0b and then you type your value {0b} in binary
8    std::cout << number << std::endl;
9
10//Output is: 15 15 15