CSE MCQs :: Ruby Programming MCQs
-
What is the output of the given code?array1 = [[1,2,3,4,5],[0,0,0,0]]array2 = [[1,2,3],[0,0,0]]print !array1
-
What is the output of the given code?array1 = [[1,2,3,4],[0,0,0,0]]array2 = [[1,2,3,4],[0,0,0,0]]print array1*array2
-
What is the output of the given code?string_array = ["a","e","i","o","u"]boolean_array = ["True","False"]puts string_array[3]puts boolean_array
-
What is the output of the given code?a=[1,2,3,4,5]b=[1,2,4,6,8]if a[3]==b[2]print "Equal"end
-
What will be the output of the following?array = [100, 200, 300, 400, 500]print array[4]
-
What will be the output of the following?array = [100, 200, 300, 400, 500]print array[5]
-
What will be the output of the following?array1 = [100, 200, 300, 400, 500]array2 = [1,2,3,4,5]if array1 == array2print "They are equal"elseprint "Not equal"end
-
What is the output of the given code? string_array = ["a","e","i","o","u"]boolean_array = ["True","False"]puts string_array[3]puts boolean_array
-
What is the output of the given code?string_array = ["a","e","i","o","u"]boolean_array = ["True","False"]puts string_array[3]puts boolean_array[1]
-
What is the output of the given code?a=["hey", "ruby", "language"]b=["hey", "ruby", "language"]if a==bprint "Equal"elseprint "Not equal"end