LOOP-1Step 1: Assign a value for
x=100 and a value for
y=3Step 2: If x < y, then go to Step 5;
otherwise, go to step 3 (Since x > y so go to step-3)Step 3: Divide by 2
(100/2=50) and set the result to be the
new value of xStep 4: Go to step 2
LOOP-2Step 1: Assign a value for
x=50 and a value for
y=3Step 2: If x < y, then go to Step 5;
otherwise, go to step 3 (Since x > y so go to step-3)Step 3: Divide by 2
(50/2=25) and set the result to be the
new value of xStep 4: Go to step 2
LOOP-3Step 1: Assign a value for
x=25 and a value for
y=3Step 2: If x < y, then go to Step 5;
otherwise, go to step 3 (Since x > y so go to step-3)Step 3: Divide by 2
(25/2=12.5) and set the result to be the
new value of xStep 4: Go to step 2
LOOP-4Step 1: Assign a value for
x=12.5 and a value for
y=3Step 2: If x < y, then go to Step 5;
otherwise, go to step 3 (Since x > y so go to step-3)Step 3: Divide by 2
(12.5/2=6.25) and set the result to be the
new value of xStep 4: Go to step 2
LOOP-5Step 1: Assign a value for
x=6.25 and a value for
y=3Step 2: If x < y, then go to Step 5;
otherwise, go to step 3 (Since x > y so go to step-3)Step 3: Divide by 2
(6.25/2=3.125) and set the result to be the
new value of xStep 4: Go to step 2
LOOP-6Step 1: Assign a value for
x=3.125 and a value for
y=3Step 2: If x < y, then go to Step 5;
otherwise, go to step 3 (Since x > y so go to step-3)Step 3: Divide by 2
(3.125/2=1.5625) and set the result to be the
new value of xStep 4: Go to step 2
LOOP-7Step 1: Assign a value for
x=1.5625 and a value for
y=3Step 2:
If x < y, then go to Step 5; otherwise, go to step 3
(Since x < y so go to step-5)Step 3: Divide by 2 and set the result to be the new value of x
Step 4: Go to step 2Step 5: Write the value of x=1.5625
Step 6: End
i.e. 7 time step-2 is performed before step-5 is reachedAnswer: Option E
Swagatalaxmi
Step 1: Assign a value for x and a value for y
Step 2: If x < y, then go to Step 5; otherwise, go to step 3
Step 3: Divide by 2 and set the result to be the new value of x
Step 4: Go to step 2
Step 5: Write the value of x
Step 6: End
If the algorithm above is applied, assigning
100 as the value of x and
3 as the value of y, how many times is step 2 performed before step 5 is reached?
A. Three
B. Four
C. Five
D. Six
E. Seven