Question: What will the following code display? bool OK = false; int C; do { cout < < What do you C? < < endl; cin

What will the following code display?

bool OK = false; int C; do { cout << "What do you C?" << endl; cin >> C; }while (OK);

It gives a syntax error.
Displays "What do you C?" infinitely.
Displays "What do you C?" once and ends after the user enters a value.
Nothing, the loop never executes.
It depends on the value the user enters for C.

Flag this Question

Question 32.5 pts

What is the output of the code snippet given below? int i = 1; do { cout << i << " "; i = i + 2; } while (i != 10);

No output
1 3 5 7 9
0 2 4 6 8
i i i i i i ... (infinite loop)
1 3 5 7 9 11 13 15 .. (infinite loop)

Flag this Question

Question 42.5 pts

What is the output of the following code snippet? int num = 0; while(num < 10); { cout << num << endl; i+=2; }

0
10
0 2 4 6 8
2 4 6 8 10 12 endless loop
Nothing, it is a silent endless loop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!