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**

# Tag: division

## Determining divisibility of number by 11 for large numbers

I’m looking for a way to determine a large number is divisible by 11 My understanding: (sum of digits at even positions – sum of digits at odd positions) % 11 == 0 ==> yes This works for some …

**Advertisement**