#include <stdio.h> int main(int ac, char **av) { unsigned short int a; unsigned short int b; printf("Enter a: "); scanf("%d", &a); printf("a = %d\n\n", a); printf("Enter b: "); scanf("%d", &b); printf("a = %d\n", a); printf("b = %d\n", b); } Output of the program: Enter a: 12 a = 12 Enter b: 53 a = 0 b = 53 My problem is that a, becomes zero after the scanf operation of b. And when I tried to use %h instead of %d the program did even stop for the inputs. I can avoid the zeroing of if and i declare another short variable between a & b. is there any compiler option that I need to enable for compiling this rightly. Thanks