ExamVeda
Login
Home
41
What is the output of the given code?
if 11>2
   puts "Eleven is greater than two"
   end
   print "You'r right"
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
42
What is the output of the given code?
if 79>78
   puts "True".upcase
   if 9>8
   puts "True".reverse
   if 7==7
   puts "equal".downcase
   end
   end
   end
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
43
What is the output of the given code?
if 79>78
   puts "True".upcase
   if 9>8
   puts "True".Upcase
   if 7==7
   puts "equal".downcase
   end
   end
   end
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
44
If statement inside if statement is called Nested if statements.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
45
What is the output of the given code?
x=1
    if x > 2
    puts "x is greater than 2"
    elsif x <= 2 and x!=0
    puts "x is 1"
    else
    puts "I can't guess the number"
    end
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
46
It's a good habit to give two spaces between if statement and condition.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
47
What is the use of else statement?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
48
Is the following syntax correct?
if conditional 
   code...
   elsif conditional 
   code..
   else
   code
   end
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
49
What is the output of the given code?
if 1>2
   puts "false"
   else
   puts "True"
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
50
What is the output of the code?
 if 1>2
   puts "false"
   end
   else
   puts "True"
   end
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board