Home / Programming Questions / Ruby MCQs / Page 11

Ruby MCQs with answers Page - 11

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

Q. String is a sequence of _________ characters.

(A) one
(B) many
(C) Both A and B
(D) None of the above

Q. String may consists of ..........

(A) Number
(B) letter
(C) Special character
(D) All of the above

Q. String are

(A) mutable
(B) unmutable
(C) Both A and B
(D) None of the above

Q. Double quotes and single quotes will interpolates ?

(A) TRUE
(B) FALSE
(C) double quotes will interpolates
(D) Single quotes will interpolates

Q. What will be output for the following code?

Code:
str1 = "LFC" puts 'str1: #{str1}'
(A) str1: LFC
(B) str1: #{str1}
(C) str1: {LFC}
(D) str1: #{LFC}

Q. what will be output for the following code?

Code:
str1 = LFC puts "str1: #{str1}"
(A) str1: LFC
(B) str1: #{str1}
(C) str1: {LFC}
(D) str1: #{LFC}

Q. In ruby, User can access the string elements by using the__________?

(A) {}
(B) []
(C) ()
(D) All of the above

Q. Ruby arrays are ____________

(A) unordered
(B) ordered
(C) Both A and B
(D) None of the above

Login

Forgot username? click here

Forgot password? Click here

Don't have account? Register here.