Home / Programming Questions / Ruby MCQs / Page 18

Ruby MCQs with answers Page - 18

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.47K Points
Coach

Q. What is the extension used for saving the ruby file?

(A) .ruby extension
(B) 8-bit bytes
(C) .rrb extension
(D) None of the mentioned

M

Mr. Dubey • 51.47K Points
Coach

Q. What is the sequence of ruby strings?

(A) 16-bit bytes
(B) PHP
(C) 10-bit bytes
(D) None of the mentioned

M

Mr. Dubey • 51.47K Points
Coach

Q. Which of the following languages syntax matches with the Ruby's syntax?

(A) Perl
(B) Convert only lowercase string to uppercase and vice-versa
(C) Java
(D) Jquery

M

Mr. Dubey • 51.47K Points
Coach

Q. What is the output of given code?
puts "what is your first name?"
   name=gets.chomp
   puts "what is your surname?"
   surname=gets.chomp

(A) Error in compilation
(B) What is your first name? xyz(enter any name) What is your surname? wtu(enter your surname)
(C) Name=xyz
(D) None of the mentioned

M

Mr. Dubey • 51.47K Points
Coach

Q. We use semicolon or parentheses after every print or puts statement.

(A) True
(B) i'AM lEARNING ruby lANGUAGE
(C) ---
(D) ---

M

Mr. Dubey • 51.47K Points
Coach

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

(A) iam learning ruby language
(B) 13 calculate length
(C) "i'am learning ruby language"
(D) None of the mentioned

M

Mr. Dubey • 51.47K Points
Coach

Q. What is the output of the given code?
"Ruby Language".length
       =begin
       calculate length
       =end

(A) 13
(B) #{expr}
(C) 12
(D) None of the mentioned

M

Mr. Dubey • 51.47K Points
Coach

Q. The .upcase and .capitalize method are used for capitalizing the whole string.

(A) True
(B) Same as 'x'
(C) ---
(D) ---

Login

Forgot username? click here

Forgot password? Click here

Don't have account? Register here.