1. Home
  2. Computer Science MCQs
  3. C Programming
  4. In C99 and later, what does the expression -7 / 2 evaluate…

Added 30 Nov -0001

In C99 and later, what does the expression -7 / 2 evaluate to?

  1. -3 Correct answer
  2. -4
  3. -3.5
  4. 3

Correct answer

A. -3

11 views

MCQSEXAM

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

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C Programming MCQs

Practise all C Programming MCQs

Similar MCQs