1 2 3 4 5 6 7 8 9
#include <stdint.h> #include <stdio.h> int main() { int16_t i; scanf("%x", &i); printf("0x%04x => %i\n", i, i); return 0; }