previous | start | next

## The `if` Statement

- The `if` statement is used to implement a decision.
- It has two parts: a test and a body.
- Example:

  >     if (area < 0)
  >        cerr << "Error: Negative area.\n";

- Multiple statements can be grouped together in a block statement by enclosing them in braces `{ }`:

  >     if (area < 0)
  >     {
  >        cerr << "Error: Negative area.\n";
  >        return 1;
  >     }

previous | start | next