Ask your own question, for FREE!
Computer Science 11 Online
OpenStudy (anonymous):

After the execution of the following piece of code, what will be the value of the variable y ? y = 1 x = 5 while ( x > 1 ) { y = y + 1 x = x - 1 } (Hint: First figure out how many times the loop executes. Notice that y gets one more for each loop.) The answer is 5. Why?

OpenStudy (konradzuse):

simple. x = 5 y = 2 x = 4 y = 3 x = 3 y = 4 x = 2 y = 5 program ends.

OpenStudy (anonymous):

now ur dout cleared or not

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!