R

Ravina • 3.59K Points
Extraordinary

Q. What will this code output?

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

Explanation by: Ravina
`!flag` negates the boolean value, so the result is `false`.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.