Boolean Expressions and Conditionals

Conditional branching using Boolean expressions are how we as programmers make decisions in our programs. They allow us to not be limited to following an identical pathway through our code each time, but rather empower us to take different forks in the road, allowing for different behaviors or different user experiences. In this section we discuss conditionals, their utility, and the three main types of conditionals offered by C – if-else, switch, and ?: (the ternary operator) as well as the Boolean expressions (<,>, <=, >=, ==, !=, &&, ||, and !).