At its heart, a program is a set of commands executed in sequence. The power in a program comes from its capability to execute one or another set of commands, based on whether a particular condition is true or false.
Today, you will learn
• What statements are
• What blocks are
• What expressions are
• How to branch your code based on conditions
• What truth is, and how to act on it
In C++, a statement controls the sequence of execution, evaluates an expression, or does nothing (the null statement). All C++ statements end with a semicolon and nothing else. One of the most common statements is the following assignment statement:
x = a + b;
Unlike in algebra, this statement ...