LearnFrenzy
Sign in Take a free test

Operators and Expressions · Operators and Expressions MCQ · Question 2

Floor division with a negative number Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 2 Back to Exercise

What is the value of -9 // 4?

  • A -2
  • B -2.25
  • C 2
  • D -3 Correct
Correct Answer: Option D

-9 / 4 = -2.25, and floor rounds toward minus infinity, giving -3. C and Java would give -2.

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