R

Ravina • 2.56K Points
Extraordinary

Q. What will this Swift code output?

Code:
let value = true
print(!value)
  • (A) true
  • (B) false
  • (C) nil
  • (D) 1
  • Correct Answer - Option(B)
  • Views: 1
  • Filed under category Swift (iOs)
  • Hashtags:

Explanation by: Ravina
`!value` inverts the boolean `true` to `false`.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.