We have seen how execution progresses from one statement to the next with simple statements. We have also seen how program execution can be diverted or redirected via a function call, after which it returns to the same place. We are now going to see how the flow of execution can change and how statements can be executed or skipped with some of C's complex statements.
Execution flow will be determined by the result of evaluating conditional expressions, which we learned about in the previous chapter. Conditional expressions may be either simple or complex. Complex conditional statements should be clear and unambiguous. If they cannot be made clear and unambiguous, they should be reworked to be less complex. When reworking them results in more awkward code, the complex conditional expression should, however, be thoroughly commented. Careful consideration should be given to the valid inputs and expected results of the conditional...