1. Based on the following C++ code fragment: int k; cin >> k; switch (k) { case 4: case 3: k = k + 5; if (k == 9) break; k -= 4; break; case 1: k += 3; default: k++; } cout


1. Based on the following C++ code fragment:




int k;
cin >> k;
switch (k) {
case 4:
case 3: k = k + 5;
if (k == 9)
break;
k -= 4;
break;
case 1: k += 3;
default: k++;
} cout < "k = " << k << endl;


a) what is displayed on the screen if the value input for k is 1 ?
a. k = 5
b. k = 3

c. k = 4

d. k = 6
b) what is displayed on the screen if the value input for k is 4 ?
a. k = 5
b. k = 8
c. k = 9
d. k = 7
c) what is displayed on the screen if the value input for k is 3 ?
a. k = 8
b. k = 5

c. k = 7

d. k = 4



"k="">

a) what is displayed on the screen if the value input for k is 1 ?
a. k = 5
b. k = 3

c. k = 4

d. k = 6
b) what is displayed on the screen if the value input for k is 4 ?
a. k = 5
b. k = 8
c. k = 9
d. k = 7
c) what is displayed on the screen if the value input for k is 3 ?
a. k = 8
b. k = 5

c. k = 7

d. k = 4



>
Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here