#include <iostream> // gain access to cout, cin, and hex using std::cout; using std::cin; using std::hex; int main() { int val; cout << "Enter a number: "; cin >> val; cout << "This is your number: "; cout << hex << val; return 0; }
Enter a number: 1 This is your number: 1