I have compiled this code.

It doesn't seem like the logic is quite right. Depending on the sequence you enter these numbers, the results differ.

As an example, if you enter just negative...