If x > y then x = x + 1 + y

Otherwise x = x + 1 - y

For example let assume that x == 2 and y == 2 in this case x is not greater than y so x will be set to x + 1 - y that is x will be equal to 1.

It is the so-called conditional operator.

Otherwise x = x + 1 - y

For example let assume that x == 2 and y == 2 in this case x is not greater than y so x will be set to x + 1 - y that is x will be equal to 1.

It is the so-called conditional operator.

Last edited on

Topic archived. No new replies allowed.