HEX:
Copy Code code as follows:
#include <iostream.h>
#include <iomanip. H>
Main (void)
{
Long n = 10000;
cout << hex << N;
return 0;
}
OCT:
Copy Code code as follows:
#include <iostream.h>
#include <iomanip. H>
Main (void)
{
Long n = 10000;
cout << Oct << N;
return 0;
}
DEC:
Copy Code code as follows:
#include <iostream.h>
#include <iomanip. H>
Main (void)
{
Long n = 10000;
cout << Dec << n << Endl;
return 0;
}
Copy Code code as follows:
#include <iostream>
using namespace Std;
int main ()
{
COUT.SETF (Ios::hex, Ios::basefield);
cout << 100; This displays 64
return 0;
}
Copy Code code as follows:
#include <iostream>
#include <iomanip>
using namespace Std;
int main ()
{
int n;
cout << "Enter A decimal number:";
CIN >> N;
cout << n << "in hexadecimal are:"
<< hex << N. << '/n '
<< Dec << n << "in octal is:"
<< Oct << N. << '/n '
<< SetBase (a) << n << "in decimal is:"
<< n << Endl;
return 0;
}