Home / Programming Questions / Ruby MCQs / Page 17

Ruby MCQs with answers Page - 17

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

M

Mr. Dubey • 51.17K Points
Coach

Q. For getting an input from the user which method is used?

(A) get
(B) gets.chomp
(C) get-s
(D) chomp

M

Mr. Dubey • 51.17K Points
Coach

Q. What will be the output of the following?
"Eric".irreverse

(A) Eric
(B) cirE
(C) undefined method
(D) None of the mentioned

M

Mr. Dubey • 51.17K Points
Coach

Q. How to comment a single line?

(A) Using #
(B) Using begin and end
(C) Using //
(D) None of the mentioned

M

Mr. Dubey • 51.17K Points
Coach

Q. What does %{Learn ruby language} represents?

(A) "Learn Ruby language"
(B) "%{Learn Ruby language}"
(C) " Learn Ruby language "
(D) None of the mentioned

M

Mr. Dubey • 51.17K Points
Coach

Q. What will any variable evaluate to if it is of Boolean data type?

(A) True
(B) Nil
(C) False
(D) Either True or False

M

Mr. Dubey • 51.17K Points
Coach

Q. What will we the output of the given code?
I'am Learning RUBY Language.downcase

(A) iam learning ruby language
(B) i'AM lEARNING ruby lANGUAGE
(C) "i'am learning ruby language"
(D) unterminated string meets end of file

M

Mr. Dubey • 51.17K Points
Coach

Q. What does the notataion \b stands for?

(A) Escape
(B) Space
(C) Backspace
(D) Newline

M

Mr. Dubey • 51.17K Points
Coach

Q. The following is the correct way to use multiline comment.
 = begin
   # comment
   = end

(A) True
(B) .rb extension
(C) ---
(D) ---

Login

Forgot username? click here

Forgot password? Click here

Don't have account? Register here.