MCQs > IT & Programming > Ruby > output of code? $var = 1 print '1 -- Step 1\n' if $var print '2 -- Step 2\n' unless $var $var = false print '3 -- Step 3\n' unless $var

Ruby MCQs

What is the output of the following code?
$var = 1
print "1 -- Step 1\n" if $var
print "2 -- Step 2\n" unless $var
$var = false
print "3 -- Step 3\n" unless $var

Answer

Correct Answer:

1 -- Step 1

3 - Step 3


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