CPP Nested If Statement MCQ
Cpp MCQ- Home
- Tutorials
- Cpp
- Nested If Statement
- Multiple Choice Question
(1) In C/C++ can we use multiple if statements in nested if statement.
A) Yes
B) No
C) Only Single
D) Only Two
Explanation
Yes we can use any no of times if statements in nested if statement.
(2) In nested if statement which statement evaluated first ?
A) Inner
B) Outer
C) Nested
D) Closer
Explanation
The evaluation of condition is always start from outer if. If the condition of outer if statement return true then inner if is evaluated.
(3) In C/C++ how many levels of nested if statement is allowed!
A) Two
B) Four
C) Eight
D) Multiple
Explanation
In C/C++ there is no limit to the levels of nesting for if or if else statement.
(4) Nested if statement with compound statements use the following parenthesis.
A) { }
B) [ ]
C) < >
D) ( )
Explanation
When we want to use if statement with multiple statements, then statements are enclosed in curly parenthesis.
(5) An if statement within another if statement is called.
A) Multiple if
B) Composite if
C) Nested if
D) Compund if
Explanation
Nested in computer programming means one statement written in body of another statement. So that this will called nested if statement.
.