Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

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

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

Answer: b
Explanation: It will print and ask you to input the name and surname
Output:
What is your first name?
xyz(enter any name)
What is your surname?
wtu(enter your surname)

Join The Discussion