Basic and Advance C Question:

Download Job Interview Questions and Answers PDF

Why doesnt that code work?

C Programming Interview Question
C Programming Interview Question

Answer:

Why doesn't the code
short int s;
scanf("%d", &s);

work?

When converting %d, scanf expects a pointer to an int. To convert to a short int, use %hd .

Download C Programming Interview Questions And Answers PDF

Previous QuestionNext Question
How can I read data from data files with particular formats?Why doesnt this code work?