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

Introduction to computing (multiple choice 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

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

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!