Assume that the following code is correctly inserted into a program: (4) int num = 1; int count; for (count = 0; count num = 2 * num + num % (count + 1); a. What is the final value of num? (i) 15...


Assume that the following code is correctly inserted into a program: (4)


int num = 1;


int count;


for (count = 0; count <>



num = 2 * num + num % (count + 1);


a. What is the final value of num?


(i) 15 (ii) 42 (iii) 26 (iv) none of these


b. If a semicolon is inserted after the right parentheses in the for loop statement, what is the final value of num?


(i) 1 (ii) 2 (iii) 3 (iv) 4 (v) none of these


c. If 5 is replaced with 0 in the for loop control expression, what is the final value of num?


(i) 0 (ii) 1 (iii) 2 (iv) none of these



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here