July 2022
Intermediate to advanced
304 pages
7h 6m
English
A computer is a powerful instrument because it can make decisions based on the data it receives. For example, a computer can turn on an LED if a button is being pressed and turn off the LED if it isn’t. In this chapter we will see how C’s various decision and control statements operate. Then we’ll apply them to embedded programming by making our device respond to button presses.
We use the if statement to execute some code only if some condition is true. Here is the general form of this statement:
if (condition)
statement;
To conditionally execute more than one statement, enclose the set ...
Read now
Unlock full access