CPP For Loop MCQ
Cpp MCQ(1) Which of the following is first expression in C++ for loop ?
A) increment/decrement
B) initialization
C) condition
D) None
Explanation
The first expression of C++ for loop statement is initialization. This is also optional part of for loop.
(2) Which of the following operator is used to separate expressions in C++ for loop statement?
A) Semicolon ;
B) Colon :
C) Comma ,
D) Ampersand &
Explanation
All the expressions of C++ for loop are separated by semicolon.
(3) Which of the following is optional in C++ for loop statement?
A) initialization
B) condition
C) increment/decrement
D) All of these
Explanation
In C++ are the expressions used in for loop statement are optional. We can skip any of them.