What will be the output of the following C code?
#include <stdio.h>
int main()
{
short int i;
scanf("%h*d", &i);
printf("%hd", i);
return 0;
}
#include <stdio.h>
int main()
{
short int i;
scanf("%h*d", &i);
printf("%hd", i);
return 0;
}A. Compilation error
B. Undefined behavior
C. Somegarbage value
D. Depends on the standard.
Answer: Option A

Join The Discussion