Question: Given the following code segment. array = [ 3 , 6 , 8 , 1 , 2 , 0 , 7 , 2 , 9

Given the following code segment.
array =[3,6,8,1,2,0,7,2,9]
i=0
odd =0
WHILE (i length(array)) AND (array [i]0) DO
IF (array[i]~~2)==1 THEN
odd = odd +1
ENDIF
i=i+1
ENDWHILE
What are the values of the variables i and odd after the while loop completes its execution?
 Given the following code segment. array =[3,6,8,1,2,0,7,2,9] i=0 odd =0 WHILE

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!