C++ cout oct conversions to octal

Description

C++ cout oct conversions to octal

#include <iostream>
#include <iomanip>
using namespace std;
int main()//w w w.ja v  a  2s .co  m
{
   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