Assignment operator is also known as relational operator.
True
False
Answer and explanation
Assignment operator is used for assigning a value.
ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
Assignment operator is also known as relational operator.
True
False
Assignment operator is used for assigning a value.
The '=' is used for assigning value to variable?
True
False
The '=' is known as assignment operator.
The == 'is equal to' is known as relational operator.
True
False
The == is used to compare two things are equal or not and hence it is known as comparator/relational operator.
Space between 2+5 or 2 + 5 is valid but =begin and = begin is not valid.
True
False
Ruby recognizes =begin and = begin in different way.
Why do we use =begin and =end?
To mark the start and end of multiline comment
To comment multiple lines
To avoid the use of # again and again
All of the mentioned
Easier way to comment multiple lines.
What is the output of the given code "Ruby".length #to find the length of given string
4 to find the length of given string
4
To find the length of given string
Ruby
It finds the length of string.
This the right way to comment a single line. "Ruby".length # I'm a single line comment!
True
False
We use # in a single line comment.
How to comment a single line?
Using #
Using begin and end
Using //
None of the mentioned
Use # to comment single line.
How to comment multiple lines in ruby?
Using multiline comments
Using single line comments
No option to comment
All of the mentioned
Multiple lines can be commented using multiline comments.
Which of the following type of comments are valid in ruby?
Single line comments
Multi line comments
Double line comments
All of the mentioned
Double line comments comes under multiline comment.
Why do we use comments?
For later use to understand the working of the program
It is an efficient way of programming
It makes easy for the third person to understand
All of the mentioned
It is the efficient way of programming and easy to understand.
A case statement compares the expression specified by case and that specified by when using the === operator and executes the code of the when clause that matches.
True
False
A case statement is basically the multiple if-elsif-else statements.
The expression specified by the when clause is evaluated as the left operand. If no when clauses match, case executes the code of the else clause.
True
False
Else clause is executed only when no 'when' clauses match.
Ruby can be used for developing internet and intranet applications.
True
False
Ruby is a server side scripting language used to create CGI(common gateway interface) scripts and hence can be used for developing internet and intranet applications.
It is must for Ruby to use a compiler.
True
False
No compiler is required for ruby as it is an interpreted language.
Ruby can be embedded into Hypertext Markup Language(HTML).
True
False
Ruby can easily be encapsulated into HTML.
Which of the following are valid floating point literal?
.5
2
0.5
None of the mentioned
floating point literals are valid only when they have digits on both the sides of decimal point.
What is the extension used for saving the ruby file?
.ruby extension
.rb extension
.rrb extension
None of the mentioned
Ruby files must be saved with the extension .rb.
Which of the following languages syntax matches with the Ruby's syntax?
Perl
PHP
Java
Jquery
Most of the syntax of perl language matches with that of Ruby's.