πŸ“Š Ruby
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
πŸ’¬ Discuss
βœ… Correct Answer: (B) FALSE

Explanation: 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.

Explanation by: Vinay Kumar
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.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
214
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Vinay Kumar
Publisher
πŸ“ˆ
89%
Success Rate