There are multiple things happening here.
“-9” will be scanned by the lexical analyzer and it’ll be treated as an integer constant preceded by minus operator which will return negative of “9”.
This negative of 9 will be stored to the memory address of y. Size of short int is 2 bytes. So, “-9” will be stored using “16” bits and let’s assume a 2’s complement representation. So, $2^{16} – 9 = 65536 – 9 = 65527$ will be stored in the memory location of “y”.
Now, int iy = y;
Here, y will return “65527” which will be copied to the memory location of “iy” (for now consider 4 bytes for int).
So, “%d” or “%u” iy will print “65527” and “%hd” y should print “-9” and “%hu” y should print “65527”.