What are the three necessary parts of an if statement?

The three necessary parts of an if statement are:

1. The condition: This is the expression that is evaluated to determine if it is true or false. It can be a comparison between two values (e.g., a > b) or an expression that returns a boolean value (e.g., x == 10).

2. The "if" keyword: This keyword is used to start the if statement, indicating that the following block of code should be executed only if the condition is true.

3. The code block: This is the set of statements that will be executed if the condition is true. It is enclosed in curly braces { } and can contain one or more statements.