It is necessary that always if should come with else block?
True
False
View Answer
Correct Answer: B — False
Explanation:
Not necessary, if can execute alone.
3 practice sets · Page 1 of 1
It is necessary that always if should come with else block?
True
False
Correct Answer: B — False
Explanation:
Not necessary, if can execute alone.
Which of the following is valid conditional statement?
else
els
if else
None of the mentioned
Correct Answer: A — else
Explanation:
Else is valid conditional statement.
What is the use of else statement?
When the if condition is false then the next else condition will get executed
When the if condition is false then the elsif condition will get executed
When the if condition is false and if else condition is true then only it will get executed
None of the mentioned
Correct Answer: C — When the if condition is false and if else condition is true then only it will get executed
Explanation:
When the if expression gives false value and the else condition is true then only it will get executed.