hex, oct, dec

Lab C++ Beginner 10 points

Print 255 in decimal, hexadecimal and octal using the dec, hex and oct manipulators, separated by spaces.

Input

None.

Output

One line.

Example

Output

255 ff 377
Sample output available
Editor
C++

Hints

hex/oct/dec change how integers are printed until changed back.

Solution explanation

Remember to switch back with dec if later numbers should be decimal.

Show solution
#include <iostream>
using namespace std;

int main() {
    int n = 255;
    cout << dec << n << " " << hex << n << " " << oct << n << "\n";
    return 0;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD