Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The simplest programs consist of one or more instructions or lines of code that the computer follows sequentially, one after another. While such sequential ordering forms the basis for programming, programs need greater flexibility to make decisions depending on the current situation.
A branch provides the computer with a choice of two or more different sets of instructions to follow. The simplest type of branch provides two choices, but there's no theoretical limit to the number of branches a program can have. A complicated program may need to make hundreds or even thousands of possible decisions.
Computers decide which choice, or branch, to follow based entirely on a certain condition, known as a Boolean condition or expression. In real life, people use Boolean expressions all the time to make decisions.