Examveda
Examveda

What is the output of the given code?
counter = 1
while counter < 11
  puts counter
  counter = counter + 1
end

A. Prints the number from 1 to 10

B. Prints the number from 1 to 11

C. Prints the number from 2 to 10

D. Infinite loop

Answer: Option A


This Question Belongs to Ruby Programming >> Control Structures In Ruby

Join The Discussion

Related Questions on Control Structures in Ruby