Question: Consider the following code segment. theList[-2, -1, 0, 1, 2] count10 count20 FOR EACH value IN theList IF(value > 0) X count1 counti+1 ELSE

Consider the following code segment. theList[-2, -1, 0, 1, 2] count10 count20 

Consider the following code segment. theList[-2, -1, 0, 1, 2] count10 count20 FOR EACH value IN theList IF(value > 0) X count1 counti+1 ELSE count2count2 + 1 What are the values of count1 and count2 as a result of executing the code segment?

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 Programming Questions!