Home »
MCQs »
C++ MCQs
Which of the following is the correct syntax of the 'for' loop?
96. Which of the following is the correct syntax of the "for" loop?
- for(condition; increment; declaration){ //body of the loop };
- for(declaration; increment/decrement; condition){ //body of the loop };
- for(initalization; condition; increment/decrement){ //body of the loop };
- None of the above
Answer: C) for(initalization; condition; increment/decrement){ //body of the loop };
Explanation:
The 3rd option is correct.