A

Admin • 828.03K Points
Coach

Q. What will be the output of the given code?

Code:
num=(10<11)||(11===11)? (11===11.0): 0
puts num
  • (A) TRUE
  • (B) FALSE
  • (C) 1
  • (D) 0
  • Correct Answer - Option(B)
  • Views: 11
  • Filed under category Ruby
  • Hashtags:

Explanation by: Admin
First check 10<11 it return true then no need to check 11===11 , condition becomes true now go to next statement 11===11.0 and it will return true.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.