Set cout: hex, basefield, setf(ios::hex, ios::basefield)
#include <iostream> using namespace std; int main() { cout.setf(ios::hex, ios::basefield); cout << 100; return 0; }