Đ Đinh Yến New member Sep 21, 2021 #1 Given that the value of SHRT_MAX is equal to 32767 and that of SHRT_MIN is equal to -32768, What will be the output of the following C code? Code: #include<stdio.h> #include<limits.h> main() { int d; d=SHRT_MAX + SHRT_MIN+1; printf("%d",d); } A. -1 B. error C. 1 D. 0
Given that the value of SHRT_MAX is equal to 32767 and that of SHRT_MIN is equal to -32768, What will be the output of the following C code? Code: #include<stdio.h> #include<limits.h> main() { int d; d=SHRT_MAX + SHRT_MIN+1; printf("%d",d); } A. -1 B. error C. 1 D. 0
Nguyễn Nguyệt Ánh New member Sep 21, 2021 #2 Answer: d Explanation: SHRT_MIN is defined as –SHRT_MAX – 1, hence the output of the code shown above will be zero. Upvote 0 Downvote
Answer: d Explanation: SHRT_MIN is defined as –SHRT_MAX – 1, hence the output of the code shown above will be zero.