How to solve expression with /=

  1. 482/10/5/2.0*2+14/5

  2. 48/5/2.0*2+14/5

  3. 9/2.0*2+14/5

  4. 4.5*2+14/5

  5. 9.0+14/5

  6. 9.0+2

  7. 11.0

Divisions go from left to right, addition comes last. An integer is only converted to double in an arithmetic operation with a double. That only happens three times: In step 3 (9/2.0), step 4 (4.5*2) and step 6 (9.0+2). All other operations are pure integer operations.

Leave a Comment