MCQ Single Best Answer Moderate

QWhat does a nested if statement allow you to do?

ID: #24863 Control flow in programming 3 views
Question Info
#24863Q ID
ModerateDifficulty
Control flow in programmingTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Combine multiple conditions
  • B Repeat a block of code multiple times
  • C Handle multiple alternatives in a single block
  • D Define a function inside another function
Correct Answer: Option B

Explanation

Correct Answer:

(A) Combine multiple conditions

Explanation:

A nested if means placing one if inside another if.

Example:

  
    if(age > 18){
if(country.equals("India")){
System.out.println("Eligible");
}
}

Share This Question

Challenge a friend or share with your study group.