Cards (9)

  • A selection structure allows the program to make decisions based on conditions, where it executes a block of code only if a specific condition is TRUE.
  • A selection structure allows the program to make decisions based on conditions, where it executes a block of code only if a specific condition is TRUE.
  • A selection structure allows the program to make decisions based on conditions, where it executes a block of code only if a specific condition is TRUE.
  • Key Structure of Selection Structure
    • if
    • if-else
    • switch
  • Key Structure of Selection Structure
    • if
    • if-else
    • switch
  • if statement syntax
    if (condition) {
    // Code to be executed if condition is true
    }
  • if-else statement syntax
    if (condition) {
    // Code to be executed if condition is true
    } else {
    // Code to be executed if condition is false
    }
  • What structure is in the picture?
    Selection Structure and a Switch Statement
  • What structure is in the picture?
    Selection Structure