What is the output of the given code? x, y, z = 12, 36, 72 puts "The value of x is #{ x }." puts "The sum of x and y is #{ x + y }." puts "The average was #{ (x + y + z)/3 }."

Question:
What is the output of the given code?

 x, y, z = 12, 36, 72
    puts "The value of x is #{ x }."
    puts "The sum of x and y is #{ x + y }."
    puts "The average was #{ (x + y + z)/3 }."

1.12,48,40

2.Syntax error

3.The value of x is 12. The sum of x and y is 48. The average was 40.

4.None of the mentioned

Posted Date:-2022-02-07 12:08:47


More MCQS Questions and answers

Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!