Home / Programming MCQs / Ruby MCQs / Question
V
Q. What will be the output of the given code?
boolean_var = !true || (true || 36 != 6**2) puts boolean_var
Explanation:
36 != 6**2 is false and true || false is true but true || !true is true hence the overall expression will evaluate to true.
You must be Logged in to update hint/solution
What does the notataion \b stands for?
What is the purpose of the times method in Ruby enumerators?
Which of the following methods is used to remove a key-value pair from a hash in Ruby?
How do you check the size of a file in Ruby?
What is the output of the code? variable=true if !variable puts "true" else puts "false" end
What is the purpose of inheritance in Ruby classes?
Which of the following is used to create a range in Ruby?
What is the correct way to declare and initialize an array in Ruby?
Discusssion
Login to discuss.