Question 1 of 25
Hints left: 3
Q1
Boolean opeartors are also known as logical operators.
Q2
Assignment operator is also known as relational operator.
Q3
Which of the following is a valid boolean operator?
Q4
The boolean operator && only result in true when both the values are true?
Q5
What is the output of the given code? counter = 1 while counter < 11 puts counter counter+=1 end
Q6
The given two expression means the same. counter=counter+1 and counter++
Q7
Which of the following are used for comparison?
Q8
What is the output of the given code? counter = 100 while counter > 0 puts counter counter/=5 end
Q9
The '=' is used for assigning value to variable?
Q10
What will the following expression evaluate to? (true && false) | | (!true)
Q11
What will be the output of the given code? boolean_2 = !true && (!true || 100 != 5**2) puts boolean_2
Q12
What is the output of the given code? a = 5 b=10 while a <10 && b<20 puts a+b a+=2 b+=2 end
Q13
What is the output of the given code? a = 5 b=10 while a <10 || b<20 puts a*b a+=2 b+=2 end
Q14
What will be the output of the given code? boolean_1 = 2**3 != 3**2 || true puts boolean_1
Q15
What is the output of the given code? counter = -50 while counter <0 puts counter counter+=10 end
Q16
What will the following expression evaluate to? true | | false
Q17
What will be the output of the given code? boolean_1 = 77 < 78 && 77 < 77 puts boolean_1
Q18
Which of the following is a valid assignment operator?
Q19
What will be the output of the given code? boolean_1 = !(700 / 10 == 70) puts boolean_1
Q20
What is the output of the given code? a = 22.5 while a >11.5 puts a a-=3.5 end
Q21
Ruby does not support ++ operator, it only supports += operator.
Q22
What will be the output of the given code? boolean_1 = !(3 < 4 || false) && (false || true) puts boolean_1
Q23
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
Q24
What is the output of the given code? a = 5 b=10 while (a <10 || b<20)&&true puts a*b a+=2 b+=2 end
Q25
The == 'is equal to' is known as relational operator.