Question: Trace the following algorithms and write down the outputs. BEGIN Set the value of x to 1 2 , y to 2 WHILE ( x

Trace the following algorithms and write down the outputs.
BEGIN
Set the value of x to 12,y to 2
WHILE (x>0)
IF (x9) THEN
set the value of y to y**2
ELSE IF (x12) THEN
set the value of y to y-2
ELSE
set the value of y to y+2
set the value of x to x-2
END OF WHILE
Print the values of x and y
END
a.x=0,y=12
b.x=0,y=32
c.x=12y=0
d.x=12y=4
 Trace the following algorithms and write down the outputs. BEGIN Set

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!