Skip to main content
Engineering LibreTexts

12: Two Way Selection

  • Page ID
    10316
    • 12.1: If Then Else
      We are going to introduce the control structure from the selection category that is available in every high level language. It is called the if then else structure. Asking a question that has a true or false answer controls the if then else structure.
    • 12.2: Boolean Data Type
      The Boolean data type is also known as the logical data type and represents the concepts of true and false. The name "Boolean" comes from the mathematician George Boole; who in 1854 published: An Investigation of the Laws of Thought.
    • 12.3: Relational Operators
      The relational operators are often used to create a test expression that controls program flow. This type of expression is also known as a Boolean expression because they create a Boolean answer or value when evaluated. There are six common relational operators that give a Boolean value by comparing (showing the relationship) between two operands.
    • 12.4: Compound Statement
      For illustration we will use the syntax for the if then else control structure within the C++ programming language. However this problem generally exists for all control structures within any language that requires the use of compound statements.
    • 12.5: Practice 11 Two Way Selection