Basics

The “If” Statement

The “If” Statement

What If? The purpose of the “if” statement is to help control the flow of logic in a program. It can be used to execute one set of code in one situation and a different set of code in a different situation. I consider “if” to be the most basic control structure in programming.

Boolean Expressions

Boolean Expressions

A fair amount of computer programming is checking the condition of something and then doing one thing if that condition is right and another thing if that condition is wrong. We call that a Boolean operation. There are two options and one must be chosen.