What is the output of the given code? [code] i = 50 while i > 25 do print 50/i i -= 1 end [/code]

Phạm Quyết

New member
What is the output of the given code?
Code:
i = 50
while i > 25 do
  print 50/i
  i -= 1
end
A. 50..25
B. 50..1
C. Infinite loop
D. 1111111111111111111111111
 
Answer: d
Explanation: The do statement here indicates that till the while condition is true execute the instructions, so here it will print all the integer values of (50/i) which
will always be one.
Code:
Output:
1111111111111111111111111
 

Tìm kiếm

Back
Top