1. Home
  2. Computer Science MCQs
  3. C Programming
  4. Given int x = 7, what value does the expression x / 2 * 2…

Added 30 Nov -0001

Given int x = 7, what value does the expression x / 2 * 2 produce?

  1. 3
  2. 6 Correct answer
  3. 7
  4. 8

Correct answer

B. 6

14 views

MCQSEXAM

Explanation

Integer division truncates 7/2 to 3, and 3 * 2 gives 6.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? 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