The else keyword always matches to the nearest if statement? State whether the statement is True (or) False And Justify it
Answers
Answered by
1
"Yes. The given statement is true.
The else keyword always matches to the nearest if statement.
If there are two if statements and after that, there is only one else statement, then the else statement will match up with the nearest if statement, which is the second one.
In nested if else statements, if there's only one else statement, then this may lead to an ambiguity which is known as dangling else problem."
Similar questions
Chemistry,
6 months ago
Hindi,
6 months ago
Math,
6 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Math,
1 year ago
History,
1 year ago