Q. Which of the following is not type of operator in ruby?

  • (A) Arithmetic Operators
  • (B) Comparison Operators
  • (C) Similar operator
  • (D) Parallel Assignment
πŸ’¬ Discuss
βœ… Correct Answer: (C) Similar operator

Q. Which operator is used to find exponent in ruby?

  • (A) *
  • (B) **
  • (C) ^
  • (D) %
πŸ’¬ Discuss
βœ… Correct Answer: (B) **

Q. eql? Operator is used for?

  • (A) Used to test equality within a when clause of a case statement.
  • (B) if the receiver and argument have both the same type and equal values.
  • (C) if the receiver and argument have the same object id.
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) if the receiver and argument have both the same type and equal values.

Q. equal? Operator is used for?

  • (A) Used to test equality within a when clause of a case statement.
  • (B) if the receiver and argument have both the same type and equal values.
  • (C) if the receiver and argument have the same object id.
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) if the receiver and argument have the same object id.
Explanation: equal? return True if the receiver and argument have the same object id.

Q. Which of the following is not a type of Bitwise Operators?

  • (A) <<
  • (B) ^
  • (C) ~
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) None of the above

Q. Guess the operator : If Condition is true ? Then value X : Otherwise value Y?

  • (A) Range Operators
  • (B) Ternary Operator
  • (C) Parallel Operator
  • (D) Arithmetic operator
πŸ’¬ Discuss
βœ… Correct Answer: (B) Ternary Operator
Explanation: first evaluates an expression for a true or false value and then Ternary Operator executes one of the two given statements depending upon the result of the evaluation

Q. In range operator ... is used for ?

  • (A) Creates a range from start point to end point inclusive.
  • (B) Creates a range from start point to end point exclusive.
  • (C) Creates a range from start point inclusive to end point exclusive.
  • (D) Creates a range from start point exclusive to end point inclusive.
πŸ’¬ Discuss
βœ… Correct Answer: (B) Creates a range from start point to end point exclusive.

Q. .......... used for Creates a range from start point to end point exclusive.

  • (A) define
  • (B) define?
  • (C) defined?
  • (D) defined
πŸ’¬ Discuss
βœ… Correct Answer: (C) defined?
Explanation: defined? is a special operator that takes the form of a method call to determine whether or not the passed expression is defined.

Q. Among the following which operator has highest Precedence?

  • (A) ::
  • (B) .
  • (C) []
  • (D) **
πŸ’¬ Discuss
βœ… Correct Answer: (A) ::
Explanation: :: has highest Precedence in ruby.

Q. Among the following which operator has lowest Precedence?

  • (A) .
  • (B) ...
  • (C) >>
  • (D) ^
πŸ’¬ Discuss
βœ… Correct Answer: (B) ...