41. What is the output of the given code?
counter = 1
while counter < 11
puts counter
counter+=1
end
counter = 1
while counter < 11
puts counter
counter+=1
end
42. What is the output of the given code?
a=10
b=9
if(a>b)
print ("a greater than b")
else
print "Not greater"
end
a=10
b=9
if(a>b)
print ("a greater than b")
else
print "Not greater"
end
43. Boolean opeartors are also known as logical operators.
44. Which of the following is a valid assignment operator?
45. What will the following expression evaluate to?
true | | false
true | | false
46. What will the following expression evaluate to?
(true && false) | | (!true)
(true && false) | | (!true)
47. What will the following expression evaluate to?
true && false
true && false
48. What is the output of the given code?
if(a==10 && b=9)
print "true"
else
print "false"
end
if(a==10 && b=9)
print "true"
else
print "false"
end
49. What is the output of the given code?
test_1 = 17 > 16
puts(test_1)
test_2 = 21 <= 30
puts(test_2)
test_3 = 9 >= 9
puts(test_3)
test_4 = -11 > 4
puts(test_4)
test_1 = 17 > 16
puts(test_1)
test_2 = 21 <= 30
puts(test_2)
test_3 = 9 >= 9
puts(test_3)
test_4 = -11 > 4
puts(test_4)
50. What will the following expression evaluate to?
!true && !false
!true && !false