Home / Programming Questions / Ruby MCQs / Page 14
Dear candidates you will find MCQ questions of Ruby here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
Y
Q. What is the output of the given ruby code?
array1 = [[1,2,3,4],[0,0,0,0]] array2 = [[1,2,3,4],[0,0,0,0]] print array1-array2
Y
Q. What is the output of the given code?
array1 = [[1,2,3,4,5],[0,0,0,0]] print !array1
M
Q. Which of the following is not correct method class IO provides?
M
Q. What will be output for the following code?
val1 = ""This is variable one"" puts ""val1""
M
Q. Which statement can be used to take any input from the user from standard screen?
M
Q. What will be output for the following code?
str = ""Hello Ruby!"" putc str
M
Q. What is the syntax to close file in ruby?
M
Q. What is the syntax to open file in ruby?
Don't have account? Register here.