How is if statement different from if…else statement?How is if statement different from if…else statement?
Answers
Answered by
4
Answer:
The if statement is used to evaluate only one condition. It performs a course of action if the condition evaluates to true
otherwise it skips the statements. The if…else control structure is used when either of the two different actions are to be performed depending upon the result of the conditional expression. It works with two blocks: if and else. In case the conditional expression evaluates to true, the statements in the if block are executed, and if the result is false, then the statements in the else block are executed
Similar questions