#include #include using namespace std; // constant begins with 0, represent octal (base 8) value // constant begins with 0x represent hexa ( base 16) int main() { int n1, x1,y1,z1; int oct1, hex1; // octal base starts with 0 x1 =022; oct1 = 017; // octa 8 *2 + 2 = 18; // * operataion preceds over + cout << "\n what is oct 022 : " << x1; // octa 8 * 1 + 7 = 15 cout <<"\n what is oct 017 : " << oct1; // hexadecimal base constant begins with 0x hex1 = 0x1F; y1 = 0x1B; z1 = 0x2B; n1 = 0xB; // = 11; //cout << "\n what is oct 022 : " << hex << 0x22; cout << "\n what is 0xB : " << n1; // 16 * 1 + 11= 27 cout << "\n what is 0x1B : " << y1; // 16 * 2 + 11 = 43 cout << "\n what is 0x2B : " << z1; // 16 * 1 + 15 = 31 ; F = 15 cout <<"\n what is 0x1F : " << hex1; return 0; }