Multiple choice

If y is of integer type, the expressions 3*(y-8)/9 and (y-8)/9*3 yield the same result if

  1. y is an even number

  2. y is an odd number

  3. (y-8) is a multiple of 9

  4. (y-8) is a multiple of 3

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Integer division truncates. 3*(y-8)/9 and (y-8)/9*3 are only equal if the division (y-8)/9 has no remainder, meaning (y-8) must be a multiple of 9.