-
What will be the output of the following C code?
#include <stdio.h>
int main()
{
short int num;
scanf("%h*d", &num);
printf("%hd", h);
return 0;
}
-
- Undefined behavior
- Compilation Error
- Runtime Error
- Somegarbage value
- None of these
Correct Option: B
Compilation Error
main.c: In function ‘main’:
main.c:6:23: error: ‘h’ undeclared (first use in this function)
printf("%hd", h);
^
main.c:6:23: note: each undeclared identifier is reported only once for each function it appears in