Q: Why doesn't the code
short int s; scanf("%d", &s);
A: When converting %d, scanf expects a pointer to an int. To convert to a short int, use %hd . (See also the table in question 12.9.)
Hosted by