Q.1.
What is the output of the the given code? puts "My name is #{Name}"
Q.2.
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} "
Q.3.
What is the output of given code?puts "what is your first name?" name=gets.chomp puts "what is your surname?" surname=gets.chomp
Q.4.
For getting an input from the user which method is used?
Q.5.
We use semicolon or parentheses after every print or puts statement.
Q.6.
What is the output of the given code?print "Hey" puts "Everyone!" print "We are learning Ruby"
Q.7.
Why is the library function ‘puts’used for?
Q.8.
Which of the following is not a valid library function?
Q.9.
The Ruby method for getting input from the user.
Q.10.
Ruby can be used for developing internet and intranet applications.
Q.11.
Text that Ruby won't run as code. Single Line Comments are declared using #. Comments are good for clarifying code and reminders.
Q.12.
Ruby does NOT require a keyword when declaring variables. Ruby uses = (assignment operator) to assign values to variables.
Q.13.
Puts - adds a new (blank) line after the thing you want to print. NOT used with print, use puts rather than print.Example:puts "Hello World!"
Q.14.
Ruby can be embedded into Hypertext Markup Language(HTML).
Q.15.
Which of the following are valid floating point literal?
Q.16.
Print - takes whatever you give it and prints it to the screenExample:print "Hello World!"
Q.17.
What is the extension used for saving the ruby file?
Q.18.
Creator of the Ruby programming language.
Q.19.
Which of the following languages syntax matches with the Ruby’s syntax?
Q.20.
Which of the following is supported by Ruby?