answers Graded A+
What will the following code display?
int number = 6;
int x = 0;
x = number--;
cout << x << endl; - ✅✅6
What will the following code display?
int number = 6;
number++;
cout << number << endl; - ✅✅7
How many times will the following loop display "Hello"?
for (int i = 0; i < 20; i++)
cout << "Hello!" << endl; - ✅✅20
What will the following code display?
int number = 6;
,cout << number++ << endl; - ✅✅6
What will the following code display?
int number = 6;
int x = 0;
x = --number;
cout << x << endl; - ✅✅5
Look at the following statement.
while (x++ < 10)
Which operator is used first? - ✅✅<
How many times will the following loop display "Hello"?
for (int i = 0; i <= 20; i++)
cout << "Hello!" << endl; - ✅✅21
What is the output of the following code segment?
n = 1;
for ( ; n <= 5; )
,cout << n << ' ';
n++; - ✅✅1 1 1 ... and on forever
What is the output of the following code segment?
n = 1;
while (n <= 5)
cout << n << ' ';
n++; - ✅✅1 1 1 ... and on forever
What will the following code display?
int x = 0;
for (int count = 0; count < 3; count++)
x += count;
cout << x << endl; - ✅✅3
What will the following code display?
int number = 6;
++number;
cout << number << endl; - ✅✅7
What will the following loop display?
, int x = 0;
while (x < 5)
{
cout << x << endl;
x++;
} - ✅✅0
1
2
3
4
How many times will the following loop display "Hello"?
for (int i = 20; i > 0; i--)
cout << "Hello!" << endl; - ✅✅20
What will the following code display?
int number = 6;
cout << ++number << endl; - ✅✅7 (chapter 5 end)
What is the output of the following program?