Let your program make decisions.

In this video:

  • bool holds true or false, which std::cout prints as 1 and 0
  • bool value{}; starts as false
  • Any number other than 0 becomes true; 0 becomes false
  • Comparisons give a bool: <, >, <=, >= and ==
  • // starts a comment: the compiler ignores the rest of the line
  • if (condition) { ... } runs the code in braces only when the condition is true
  • else { ... } runs when it isn't