Question: What initial value of num would prevent cnt from being incremented three times or more in the following code? int main() { int cnt =

What initial value of num would prevent cnt from being incremented three times or more in the following code?

int main() {

int cnt = 10; int num = 1;

do {

cnt = cnt + 1;

num = num - 1;

} while (num != 0);

cout << cnt;

return 0;

}

Select one:

a. No such value

b. 0

c. 2

d. 4

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!