#include <iostream>
#include <iomanip>
usingnamespace std;
int main()
{
shortint a = 0xEB90;
cout << "a = " << a << " (dec)" << endl;
cout << "a = " << hex << a << " (hex)" << endl;
return 0;
}
a = -5232 (dec)
a = eb90 (hex)
If you use an unsigned short integer, the decimal value will be 60304, but that's merely a matter of how the value is interpreted, internally it is still stored as the same binary digits.