CSE MCQs :: Ruby Programming MCQs
-
What is the output of the given code?counter = 2while counter < 68puts countercounter**=2end
-
What is the output of the given code?a="string"b="strings"if(a==b)print ("a and b are same")elseprint "Not same"end
-
What is the output of the given code?m= 0loop dom += 1print mbreak if m == 10end
-
What is the output of the given code?for num in 1..5puts num*numendx
-
What will be the output of the given code?boolean_1 = 77 less than 78 && 77 less than 77puts boolean_1
- What will the following expression evaluate to? true || false
-
What is the output of the given code?a="hungry"until !aputs "hungry"a=!aend
-
What is the output of the given code?m= 8loop dom += 2puts mbreak if m == 16end
-
What is the output of the given code?i = 3while i > 0 doprint ii -= 1end
-
What is the output of the given code?a = 5b=10while aputs a*ba+=2b-=2end