Question: Introduction to computing (multiple choice question) Questions 1-4 refer to the following program segment. Assume that all variables are of type int. z 0; g
Questions 1-4 refer to the following program segment. Assume that all variables are of type int. z 0; g 0; i 0, while (i 0) else z 1 i it 1 How many times is the loop body of the while statement executed? a. Once b. never c. 49 times 50 times e. until a number 50 or larger is entered 2. The value stored in variable s at the end of the execution of the loop could best be described as a. the average of the numbers scanned b. the sum of the numbers scanned c. the largest of the numbers scanned d. how many numbers were scanned e. the sentinel value 3. The value stored in variable z at the end of the execution of the loop could best be described as a. how many positive items were scanned b. the sum of all positive items scanned c. how many negative items were scanned d. the sum of all negative items scanned e. the sentinel value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
