C++ cout hex conversions to hexadecimal

Description

C++ cout hex conversions to hexadecimal

#include <iostream>
#include <iomanip>
using namespace std;
int main()/*from   w w w .j  a va 2 s. c om*/
{
   cout << "The decimal (base 10) value of 15 is " << 15 << endl;
   cout << "The octal (base 8) value of 15 is " << showbase << oct << 15 <<endl;
   cout << "The hexadecimal (base 16) value of 15 is " << showbase << hex << 15 << endl;
   return 0;
}



PreviousNext

Related