The if () block is a Control Block and a C Block. It reads the boolean statement embedded in its hexagonal shape, taking action if the statement is read as true. Nothing will happen if it is read as false.
This block is widely used, as it is one of the few ways to read statements. Defining every possible use of it would take a long time, but some examples are shown below:
- Simply reading code
- Continuously checking if input is given