Sridhar <asridhar@xxxxxxxxxx>: > 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 %h is a modifier. you need to say "%hd". actually, you should say "%hu" since you're using unsigned short ints. --