In C99 and later, what does the expression -7 / 2 evaluate to?
-
A
-3
Correct answer
-
B
-4
-
C
-3.5
-
D
3
11 views
Explanation
C99 requires integer division to truncate toward zero, so the result is -3 rather than -4.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ