Skip to content
Advertisement

Tag: operator-precedence

division in java programming

The same formula gives different answers to 2296 and 1500, when the expected answer in both cases is 100. Please explain this behavior. I’m quite surprised by this simple thing. Initially I thought this must be due to operator precedence but I cannot understand this. program with 2296 : output: first formula ===>100 alternate formula =====>104 same program with 1500:

Advertisement