πŸ“Š C++
Q. How many times does the “cout” in line 12 run?
Code:
#include  
using namespace std; 
  
int main() 
{ 
    int n = 10; 
    for (int i = 0; i < n; i++ ) 
    { 
        n++; 
        continue; 
        cout << n; 
    } 
  
    return 1;
}
  • (A) 10
  • (B) 11
  • (C) 1
  • (D) The “cout” never runs.
πŸ’¬ Discuss
βœ… Correct Answer: (D) The “cout” never runs.

Explanation: The “continue” instruction will never let the “cout” instruction be executed and therefore never executed.

Explanation by: Team MCQ Buddy
The “continue” instruction will never let the “cout” instruction be executed and therefore never executed.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
202
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
81%
Success Rate