I would expect the result to be "0, 5, 7, 22". That's the only strange thing here, you have no right to expect this. You are assuming left to right semantics, but there is no such requirement in C.