Important MCQ

How many levels of nesting are allowed in C++?

Q.How many levels of nesting are allowed in C++?

A) Only 3
B) Only 2
C) Only 1
D) Many (limited only by compiler)
Correct Answer:
Option D
Detailed Explanation:
D) Many (limited only by compiler) is correct. A nested if is an if statement inside another if. The inner condition is reached only if execution enters the outer block; braces and indentation make the structure clear.