13. What is the output for the following loop?
int number;
bool done;
number = 2;
done = FALSE;
while (!done)
{
number = number * 2
if (number > 12)
done = TRUE;
cout << number << endl;
}
If written correctly, the output of your second loop should be three even numbers, all increasing by a 2 order of magnitude (aka base 2).
The first loop, as @AngelicaEms said, outputs the numbers 2 through 11. If this is for a test or some kind of homework assignment, I'd highly suggest reviewing loop control, because it's going to get a whole lot harder once your professors introduce iterators and pointers.