
70 Input and Output in C++
OUTPUT
Hexadecimal of 184 is : b8
Octal of 15 is : 17
Decimal of 0xfe is : 254
Explanation: In the above program, the properties of setf() function are set to ios::hex,
ios:: oct, and ios::dec. After this setting, the decimal number given in cout() state-
ment will convert to its hexadecimal and octal equivalent, respectively. The hexadecimal number
0xfe is converted to its decimal equivalent.
3.12 FLAGS WITHOUT BIT FIELDS
The flags described in Table 3.6 have no corresponding bit fields. The programs on these func-
tions are illustrated as follows.
Table 3.6 Flags without Bit Fields
Flag Working
ios :: showbase Uses base indicator ...