What is the output of the given code? unless true && false print "false" else ...
View Question
What is the output of the given code?
counter=12
unless counter
print counter+1
else
print counter+2
end
What is the output of the given code? counter=12 unless counter print counter+1 else print counter+2
View Question
The following syntax is also used for unless conditional statement.
code unless conditional
The following syntax is also used for unless conditional statement. code unless conditional a) True b) ...
View Question
What is the output of the given code?
hungry=false
unless hungry
print “Not hungry”
else
print “Hungry”
end
What is the output of the given code? hungry=false unless hungry print "Not hungry" else print ...
View Question
What is the output of the given code?
var = 1
print “1 — Value is set\n” if var
print “2 — Value is set\n” unless var
var = false
print “3 — Value is set\n” unless var
What is the output of the given code? var = 1 print "1 -- Value is set\n" ...
View Question
What is the output of the given code?
x=3
unless x>2
puts “x is less than 2”
else
puts “x is greater than 2”
end
What is the output of the given code? x=3 unless x>2 puts "x is less than 2" else
View Question
Syntax for unless conditional statement is
unless conditional [then]
code
else
code
end
Syntax for unless conditional statement is unless conditional [then] code else code ...
View QuestionIt is necessary that always if should come with else block?
a) True b) False Answer: b Explanation: Not necessary, if can execute alone.
View Question
What is the output of given code?
#counter=1
if counter<=5
puts (counter)
counter=counter+1
else
puts(counter)
counter=counter-1
end
What is the output of given code? #counter=1 if counter<=5 ...
View Question
What is the output of given code?
counter=1
if counter<=5
puts (counter)
counter=counter+1
else
puts(counter)
counter=counter-1
end
What is the output of given code? counter=1 if counter<=5 ...
View Question