A

Admin • 833K Points
Coach

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.
  • Correct Answer - Option(D)
  • Views: 22
  • Filed under category C++
  • Hashtags:

Explanation by: Admin

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

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.