Skip to main content
Engineering LibreTexts

18: Conditional Operator and Recursion

  • Page ID
    10358
    • 18.1: Conditional Operator
      The conditional operator is unique in that it has three operands separated by two unconnected operator symbols. All other C++ operators are either unary (one operator and one operand) or binary (one operator and two operands). On the "Abbreviated Precedence Chart for C++ Operators" the conditional operator has the word "trinary" in the comments column.
    • 18.2: Recursion vs Iteration
      Iteration is one of the categories of control structures. It allows for the processing of some action zero to many times. Iteration is also known as looping and repetition. The math term "to iterate" means to perform the statement parts of the loop. Many problems/tasks require the use of repetitive algorithms.
    • 18.3: Practice 17 Conditional Operator and Recursion