Skip to main content
Logo image

Chapter 9 Branching

In this chapter, we’ll cover the following topics:
  • Making decisions at run-time of your code using if statements
  • if statements with an "otherwise" condition: if - else statements
  • Logic statements
  • Relation and equality statements
  • if - else if - else statements
  • Explore how logical operators and expressions work in C (and in coding, more generally). It turns out, our English language often makes certain assumptions when it comes to logic with which we are all familiar. But when talking to the computer we need to be more explicit so that our logic gets interpreted correctly.
  • How to represent a true/false value in C using tools we have already discovered
  • While we may want to know if our logical expression is true, we also may want to know if it is NOT true. We will take a look at how we can easily negate our logical expressions, so we will know if something is NOT true.