Display hexadecimal value as decimal value : Hexadecimal « Data Type « C++






Display hexadecimal value as decimal value

   
#include <iostream>
using namespace std; 
int main(void){
   cout << "Decimal value " << dec << 0xFF;
   cout << "\nOctal value " << oct << 10;
   cout << "\nHexadecimal value " << hex << 255;
}
  
    
    
  








Related examples in the same category

1.Display hexadecimal integer literals and decimal integer literals.
2.Output Hexadecimal default
3.Output Hexadecimal without base
4.Output Hexadecimal with uppercase base
5.Output Hexadecimal with lowercase base
6.Output digits in hex and octOutput digits in hex and oct
7.gain access to cout, cin, and hexgain access to cout, cin, and hex
8.Reads integral decimal values and generates octal, decimal, and hexadecimal output
9.Enter hexadecimal digits and a floating-point numberEnter hexadecimal digits and a floating-point number
10.Set cout to output hex number