πŸ“Š C++
Q. Which of the following is the correct syntax for a for loop in C++?
  • (A) for(int i=0; i<5; i++)
  • (B) for(int i=0; i<=5; i++)
  • (C) for(int i=0; i<5; i++) { }
  • (D) for(int i=0; i<5) { }
πŸ’¬ Discuss
βœ… Correct Answer: (A) for(int i=0; i<5; i++)

Explanation: The correct syntax for a 'for' loop in C++ is 'for(initialization; condition; increment)'.

Explanation by: Shiva Ram
The correct syntax for a 'for' loop in C++ is 'for(initialization; condition; increment)'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
240
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Shiva Ram
Publisher
πŸ“ˆ
95%
Success Rate