control structures

Cards (11)

  • selection structures - if , if else, if else if else, switch case, conditional operators
  • selection structures- allows you to execute different blocks of code based on a certain condtion
  • repetition structures- execute repeteadly
  • 3 types of structures- repetion, control , selection
  • Control structures dictate the flow of execution within a program.
  • Sequence: For executing statements in a predefined order.
  • if statement
    Executes a block of code if a specified condition is true.
  • if ... else if ... else statement
    Allows checking multiple conditions and executing different blocks accordingly.
  • switch ... case statement
    Evaluates an expression and executes code blocks based on matching cases.
  • Conditional (ternary) operator ?:Provides a concise way of writing if-else statements for assigning values.
  • Repetition structures, also known as looping statements,