A

Admin • 833K Points
Coach

Q. What is the output of the following C++ code?

Code:
#include <iostream>
using namespace std;

int main()
{
int n = 5, i;
for (i = 0; i < n; i++)
{
n++;
cout << n << endl;
goto a;
}
a:
do
{
cout << "label a" << endl;
break;
}
while( 0 );
return 1;
}
  • (A) 5 label a
  • (B) 5
  • (C) label a
  • (D) 6 label a
  • Correct Answer - Option(D)
  • Views: 24
  • Filed under category C++
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.