Q. How to comment a single line?

  • (A) Using #
  • (B) Using begin and end
  • (C) Using //
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) Using #

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

  • (A) "Learn Ruby language"
  • (B) "%{Learn Ruby language}"
  • (C) " Learn Ruby language "
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) "Learn Ruby language"

Q. What will any variable evaluate to if it is of Boolean data type?

  • (A) True
  • (B) Nil
  • (C) False
  • (D) Either True or False
πŸ’¬ Discuss
βœ… Correct Answer: (D) Either True or False

Q. What will we the output of the given code?
I'am Learning RUBY Language.downcase

  • (A) iam learning ruby language
  • (B) i'AM lEARNING ruby lANGUAGE
  • (C) "i'am learning ruby language"
  • (D) unterminated string meets end of file
πŸ’¬ Discuss
βœ… Correct Answer: (D) unterminated string meets end of file

Q. What does the notataion \b stands for?

  • (A) Escape
  • (B) Space
  • (C) Backspace
  • (D) Newline
πŸ’¬ Discuss
βœ… Correct Answer: (C) Backspace

Q. The following is the correct way to use multiline comment.
= begin
# comment
= end

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

Q. What is the extension used for saving the ruby file?

  • (A) .ruby extension
  • (B) 8-bit bytes
  • (C) .rrb extension
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) 8-bit bytes

Q. What is the sequence of ruby strings?

  • (A) 16-bit bytes
  • (B) PHP
  • (C) 10-bit bytes
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) PHP

Q. Which of the following languages syntax matches with the Ruby's syntax?

  • (A) Perl
  • (B) Convert only lowercase string to uppercase and vice-versa
  • (C) Java
  • (D) Jquery
πŸ’¬ Discuss
βœ… Correct Answer: (A) Perl

Q. What is the output of given code?
puts "what is your first name?"
name=gets.chomp
puts "what is your surname?"
surname=gets.chomp

  • (A) Error in compilation
  • (B) What is your first name? xyz(enter any name) What is your surname? wtu(enter your surname)
  • (C) Name=xyz
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) What is your first name? xyz(enter any name) What is your surname? wtu(enter your surname)