How to display number in hexadecimal form in C++ Program
#include
int main()
{
int x;
cout << Enter an integer:" << endl; cin >> x; // hex keyword displays a number in hexadecimal form.
cout << "x=" << hex << x << endl;
cin.get();
return 0;
}