int number{};
number = 15; //integer literal
std::cout << number << std::endl;
number = 0x0F; // 0x - and then you type your value {0F} in hexadecimal
std::cout << number << std::endl;
number = 0b1111; // 0b and then you type your value {0b} in binary
std::cout << number << std::endl;
//Output is: 15 15 15
Code Example |
---|
Cpp :: cpp print variable value |
Cpp :: c++ get maximum value unsigned int |
Cpp :: what is - in c++ |
Cpp :: max in c++ |
Cpp :: c++ filesystem read directory |
Cpp :: sleep in c++ |
Cpp :: sort array c++ |
Cpp :: binary search c++ |
Cpp :: c++ add two char together |
Cpp :: find element in vector |
Cpp :: new line in c++ |
Cpp :: pure virtual function in c++ |
Cpp :: zero fill in c++ |
Cpp :: check if element in dict c++ |
Cpp :: set to vector |
Cpp :: c++ Least prime factor of numbers till n |
Cpp :: factorial in c++ using recursion |
Cpp :: how to create 2d array using vector in c++ |
Cpp :: why convert char* to string c++ |
Cpp :: convert all strings in vector to lowercase or uppercase c++ |
Cpp :: c++ math |
Cpp :: double array c++ |
Cpp :: range based for loop c++ |
Cpp :: bfs sudocode |
Cpp :: c++ convert int to cstring |
Cpp :: adding variables c++ |
Cpp :: c++ while loop |
Cpp :: bit++ codeforces in c++ |
Cpp :: backtrack |
Cpp :: c++ write string |