It's rather far from correct. In the ?: operator the condtion is to the left, and if, else are to the right, separated with colon. That's just it. Enclose the three sections of code with parenthesis and you have your if - else statement:
(condition) ? ( if true) : (if false).
Your example may be confusing, but don't get mislead - you CAN use += statement as part of condition.
so wait im confused so when i changed the conditional operators to if/else statement thats incorrect? by the way i got that conditional operator example from my book
@Blank, your conversion was totally correct. Somehow as Disch pointed out the original statement does not make a lot of sense ( at least supposing we are using integers and default operators ).
And if it was not clear to someone operator ?: is just above assignment in priority.
@ snowright: Regardless of assignment vs. comparison conditional operator order, multiplication will always be performed before addition so the entire test is redundant.