Question 1
Back to Exercise
What is the value of the expression 7 / 2 in C?
- A 3.5
- B 3 Correct
- C 4
- D 3.0
Correct Answer: Option B
Both operands are int, so C performs integer division and discards the fraction (truncating toward zero). Make one operand floating – 7 / 2.0 – to get 3.5.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!