Consider the following code (and assume that it is embedded in a complete and correct program and then run):
int count = 0;
cout << "Enter a line of input:\n";
cin >> next;
while (next != '\n')
{
if ((count%2) == 0)
cout << next;
count++;
cin >> next;
}
If the dialogue begins as follows, what will be the next line of output?
Enter a line of input:
0 1 2 3 4 5 6 7 8 9 10 11
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.