Display decimal value as hexadecimal value : int output « Data Type « C++






Display decimal value as hexadecimal 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.Decimal in hexadecimal
2.Decimal in octal
3.Decimal in decimal
4.Display decimal value as Octal value
5.Output integer with different base: 8, 10, 16
6.Right justification
7.Left justification
8.Use .(dot) as place holder
9.Set width of output
10.Using hex, oct, dec and setbase stream manipulators.
11.Printing an integer with internal spacing and forcing the plus sign.
12.Set showpos flag for decimal
13.Making I/O in Octal Format