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} "
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. Give your address
C. What's your address? Chennai
Tamilnadu
600048
Iam from Chennai city, Tamilnadu state, pincode: 600048
D. None of the mentioned
Answer: Option C
Related Questions on Basic Syntax in Ruby
What does the 'puts' method do in Ruby?
A. Prints to console
B. Converts to string
C. Finds the length
D. Reads input from user
Join The Discussion