MCQs > IT & Programming > Ruby > puts 'This is sentence 1.' BEGIN { puts 'This is sentence 2.' }

Ruby MCQs

What is the output of the following code. when executed at the Ruby command prompt?

puts "This is sentence 1."

BEGIN {

    puts "This is sentence 2."

}


Answer

Correct Answer:

This is sentence 2.

This is sentence 1.


Explanation:

Note: This Question is unanswered, help us to find answer for this one

Ruby Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Ruby Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it