Home / Programming Questions / Ruby MCQs / Page 5

Ruby MCQs with answers Page - 5

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

V

Vinay Kumar • 8.45K Points
Tutor III

Q. Which of the following datatypes are valid in Ruby?

(A) Numbers
(B) String C
(C) Boolean
(D) All of the above

V

Vinay Kumar • 8.45K Points
Tutor III

Q. Why can not we use quotation marks ("or") with boolean?

(A) It indicates that we are talking about a string
(B) It indicates that we are assining a value
(C) It indicates that that we are replacing boolean data type with string data type
(D) None of the above

V

Vinay Kumar • 8.45K Points
Tutor III

Q. What is the sequence of ruby strings?

(A) 16-bit bytes
(B) 8-bit bytes
(C) 4-bit bytes
(D) None of the above

V

Vinay Kumar • 8.45K Points
Tutor III

Q. What is the output of the given code?

Code:
my_string=Ruby
puts(my_string)
(A) Ruby
(B) Nil
(C) Error
(D) my_string

V

Vinay Kumar • 8.45K Points
Tutor III

Q. single-quoted strings don`t allow ?

(A) substitution
(B) backslash notation
(C) single-quoted strings allow substitution and backslash notation.
(D) single-quoted strings don`t allow substitution and allow backslash notation.

V

Vinay Kumar • 8.45K Points
Tutor III

Q. Which type of number(0b1011 ) is ?

(A) Octal
(B) Hexadecimal
(C) Binary
(D) Decimal

V

Vinay Kumar • 8.45K Points
Tutor III

Q. Objects of which class does the integer from the range -2^30 to 2^(30-1) belong to?

(A) Octal
(B) Bignum
(C) Fixnum
(D) Binary

V

Vinay Kumar • 8.45K Points
Tutor III

Q. Objects of which class does the integer from the range -2^60 to 2^(60-1) belong to?

(A) Octal
(B) Bignum
(C) Fixnum
(D) Binary

Login

Forgot username? click here

Forgot password? Click here

Don't have account? Register here.