I need to maintain a 16 bit number in a variable and do some shift operations in it. Short is supposed to be 16 bits. But when I left shift my 16 bit number contained in a short variable it is giving an output of more than 16 bit.
Please tell me how can I restrict my output to 16 bits even after shifting.