Can someone please help me with this?

What is the output for the following loop? Im very new to programming and am having issues.

int number;
number = 1;
while (number < 11)
{
number = number + 1;
cout << number << endl;
}
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;
}

The output of your first code is:

2
3
4
5
6
7
8
9
10
11

The output of the second one is error.

What output do you expect? Don't you have any compiler?

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.
Topic archived. No new replies allowed.