Q. Ruby can deal with both numbers and floating point values.

  • (A) True
  • (B) Prints whatever is given and insert a new(blank) line
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (A) True

Q. It is must for Ruby to use a compiler.

  • (A) True
  • (B) ybuR
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (B) ybuR

Q. What is the use of .capitalize method?

  • (A) It capitalizes the entire string
  • (B) It capitalize on the first letter of the string
  • (C) It capitalize the strings which are in small case
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) It capitalize on the first letter of the string

Q. Which of the following is not a valid datatype?

  • (A) Float
  • (B) Integer
  • (C) Binary
  • (D) Timedate
πŸ’¬ Discuss
βœ… Correct Answer: (D) Timedate

Q. Ruby is an object oriented general purpose programming language.

  • (A) True
  • (B) Name variable not defined earlier
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (A) True

Q. What is the output of the the given code?
puts "My name is #{Name}"

  • (A) Error in compilation
  • (B) "%{ Learn Ruby language }"
  • (C) My name is #{Name}
  • (D) Undefined Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) "%{ Learn Ruby language }"

Q. What does %Q{ Learn ruby language } represents?

  • (A) " Learn Ruby language "
  • (B) Hey everyone we are learning Ruby
  • (C) " Learn Ruby language "
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) " Learn Ruby language "

Q. What is the output of the given code?
print "Hey"
puts "Everyone!"
print "We are learning Ruby"

  • (A) Error
  • (B) Give your address
  • (C) Hey everyone
  • (D) Hey Everyone We are learning Ruby
πŸ’¬ Discuss
βœ… Correct Answer: (D) Hey Everyone We are learning Ruby

Q. Ruby can be embedded into Hypertext Markup Language(HTML).

  • (A) True
  • (B) What's your first name? amil What's your last name? jones My name is Amil Jones
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (A) True

Q. What is the output of the given code?
print "What's your address"
city,state,pin=gets.chomp,gets.chomp,gets.chomp
puts "Iam from #{city} city, #{state} state, pincode: #{pin} "

  • (A) Error in compilation
  • (B) Substituting string functions
  • (C) What's your address? Chennai Tamilnadu 600048 Iam from Chennai city, Tamilnadu state, pincode: 600048
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) What's your address? Chennai Tamilnadu 600048 Iam from Chennai city, Tamilnadu state, pincode: 600048