Question: Integer num _ successes is initialized with 0 . Input consists of integers that are raw data of an experiment. Write a while loop that

Integer num_successes is initialized with 0.
Input consists of integers that are raw data of an experiment.
Write a while loop that iterates until num_successes is equal to 2.
In each iteration of the loop:
Read integer curr_depth from input.
If curr_depth is greater than 0,
then increment num_successes and output curr_depth.
input is:
0
2
32
then the output is:
2
32
Note: Assume that input has at least two integers.

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!