Java OCA OCP Practice Question 1352

Question

What is -15 % -10?

  • A. 0
  • B. 5
  • C. 10
  • D. -5
  • E. -10


D.

Note

15 % 10 is 5, so the magnitude of the result is 5.

The sign of the result is the sign of the left-hand operand, so the result is -5.




PreviousNext

Related