ExamVeda
Login
Home
1
The complement of while loop is until loop.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
2
What is the output of the given code?
counter = 1
until counter > 10
  puts counter
counter+=1 
  end
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
3
What is the output of the given code?
counter = 0
until counter >= 10
  puts counter
counter+=1 
  end
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
4
What is the output of the given code?
i = 3
while i > 0 do
  puts i
  i -= 1
end
 
j = 3
until j == 0 do
  puts j
  j -= 1
end
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
5
What is the output of the given code?
a="hungry"
until !a
puts "hungry"
a=!a
end
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
6
What is the output of the given code?
m= 8
loop do
    m += 2
    puts m
    break if m == 16
end
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
7
What is the output of the given code?
m=0
loop do
    print "ruby"
    m+=1
    break if m==5
end
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
8
What is the output of the given code?
m=0
loop do
    puts m*10
    m+=1
    break if m==5
end
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
9
What is the output of the given code?
m=0
loop do
    puts 101
    m+=1
    break if m==5
end
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
10
What is the output of the given code?
m=5
loop do
    m-=1
    break if m==0
end
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board