πŸ“Š Ruby
Q. What will be the output of the given code?
Code:
boolean_var = !true || (true || 36 != 6**2)
puts boolean_var
  • (A) TRUE
  • (B) FALSE
  • (C) Error
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) TRUE

Explanation: 36 != 6**2 is false and true || false is true but true || !true is true hence the overall expression will evaluate to true.

Explanation by: Vinay Kumar
36 != 6**2 is false and true || false is true but true || !true is true hence the overall expression will evaluate to true.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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