CPP If Statement MCQ
Cpp MCQ- Home
- Tutorials
- Cpp
- If Statement
- Multiple Choice Question
(1) Which of the following control structure is implemented using if statement ?
A) Sequential
B) Selection
C) Repetition
D) Function Call
Explanation
If statement is implementation of selection structure.
(2) If statement condition always written in ____ parenthesis.
A) Square
B) Curly
C) Angle
D) Small
Explanation
Condition of if statement always written in small ( ) parenthesis.
(3) Which of the following expression can be used as condition with if statement?
A) Arithmetic
B) Relational
C) Logical
D) Both B and C
Explanation
Both relational and logical expressions return either True or False. These both expressions cam be used as condition in C/C++.
(4) Which of the following delimiters are used to create block of statements.
A) < >
B) [ ]
C) " "
D) { }
Explanation
Curly parentheses are used to make block of statements in C++.
(5) if statement excute statement or set of statements only if given condition is.
A) True
B) False
C) Never
D) All of thees
Explanation
Statements are only executed when the given condition goes True. Otherwise statements will skipped.
(6) Which of the following is valid selection structure keyword in C++
A) IF
B) iF
C) if
D) IFF
Explanation
if is valid keyword for selection statement in C++. C++ is a case sensitive language and all keywords are written in lower case.