What is the range of octal notation (\nnn)?
0-8
0-7
0-A
None of the mentioned
Answer and explanation
Octal notation ranges from 0-7.
ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
11 practice sets · Page 1 of 1
What is the range of octal notation (\nnn)?
0-8
0-7
0-A
None of the mentioned
Octal notation ranges from 0-7.
Which of the following is not a valid datatype?
Float
Integer
Binary
Timedate
datetime is valid datatype but timedate is not a valid datatype.
What is the sequence of ruby strings?
16-bit bytes
8-bit bytes
10-bit bytes
None of the mentioned
They are simply the sequence of 8-bit bytes.
What does the notataion \b stands for?
Escape
Space
Backspace
Newline
This notataion is used for backspace.
Objects of which class does the integer from the range -2^30 to 2^(30-1) belong to?
Bignum
Octal
Fixnum
Binary
Integer within this range are objects of the class fixnum.
Ruby can deal with both numbers and floating point values.
True
False
We can assingn a integer and a floating point value to a variable.
What is the size of an integer data type in ruby?
-2^{30} to 2^{30}
-2^{30} to 2^{(30-1)}
-2^{29} to 2^{30}
-2^{60} to 2^{61}
Integer ranges from -2^{30} to 2^{29} and lies in object of class Fixnum.
Ruby is a case-sensitive language.
True
False
Ruby differentiates between small and capital letters and their meaning.
Why can not we use quotation marks (' or ") with boolean?
It indicates that we are talking about a string
It indicates that we are assining a value
It indicates that that we are replacing boolean data type with string data type
None of the mentioned
Quotation marks are used only with strings.
What will any variable evaluate to if it is of Boolean data type?
True
Nil
False
Either True or False
Boolean data types will give the value either as True or False depending on the condition.
Which of the following datatypes are valid in Ruby?
Numbers
Boolean
String
All of the mentioned
Ruby supports all the three (numbers,strings,boolean) data types.