ExamVeda
Login
Home
51
What is the output of the code?
variable=true
   if variable
   puts "true"
   else
   puts "false"
   end
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
52
What is the output of the code?
 variable="true".reverse
   if variable
   puts "true"
   else
   puts "false"
   end
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
53
What is the output of the code?
variable=true
   if !variable
   puts "true"
   else
   puts "false"
   end
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
54
What is the output of the code?
variable="true".length
   if variable
   puts "true"
   else
   puts "false"
   end
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
55
Which of the following is valid conditional statement?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
56
What is the output of given code?
 counter=1
    if counter<=5
    puts (counter)
    counter=counter+1
    else 
    puts(counter)
    counter=counter-1
    end
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
57
What is the output of given code?
#counter=1
    if counter<=5
    puts (counter)
    counter=counter+1
    else 
    puts(counter)
    counter=counter-1
    end
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
58
It is necessary that always if should come with else block?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
59
Which of the following is valid conditional statement in Ruby?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
60
The elsif conditional statement is written with an expression.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board