Evaluation 300 * 300/300 occurs from left to right.
300 * 300 overflows with a 16-bit signed int type ( int in Turbo C ++ is 16 bits). Since the calculation will be performed in signed arithmetic, the result is undefined .
What happens, 300 * 300 wraps around to give you 24464. (24464 + 32768 + 32768 = 90,000).
24464/300 - 81 in whole divisions.
source share