Draw the most interesting news story this week
What type of statement is an if-else statement?
If else conditionals are used to execute different parts of code depending on a condition. The condition is a boolean expression that evaluates to either true or false. Code blocks are used to group statements together.
If Else Conditionals in C++
boolean expression: A statement that evaluates to either true or false. condition: An expression that is evaluated to determine which code block should be executed. code block: A group of related statements.
Concepts:
Write: What are the basic rules of writing an 'if' statement in C++?
Write: How can you use an 'if else' statement to make decisions in a program?