home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_11_07
/
1107105b
< prev
next >
Wrap
Text File
|
1993-04-29
|
528b
|
24 lines
// base2.cpp: Shows the bases of integers
// (Uses manipulators)
#include <iostreams.h>
main()
{
int x, y, z;
cout << "Enter three ints: ";
cin >> x >> y >> z;
cout << x << ',' << y << ',' << z << endl;
// Print in different bases
cout << dec << x << ',' << oct << y << ','
<< hex << z << endl;
// Show the base prefix
cout.setf(ios::showbase);
cout << dec << x << ',' << oct << y << ','
<< hex << z << endl;
return 0;
}