Introduction
If and if-else statements help your program make choices. They let your code do different things based on conditions.
To check if a number is positive or negative.
To decide what message to show based on user input.
To run some code only if a condition is true.
To choose between two actions depending on a test.
To handle simple decision-making in your app.