If vs Else If

A Guide for the Aspiring Programmer

Big image

What is an If Statement?

  • Used to implement a decision.
  • If the test succeeds, the body of the statement is executed.
Big image

IF STATEMENTS

  • Most basic of all the control flow statements
  • Good for two option situations
Big image

BOTH

  • Uses Boolean Operators
  • Conditional statements
  • Can be nested

ELSE IF STATEMENTS

  • Can test more than two choices
  • Faster than a giant list of if statements
Big image