LearnFrenzy
Sign in Take a free test

Operators and Expressions · Operators MCQ · Question 1

What is 7 / 2 in C? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links