A

Admin • 670.22K Points
Coach

Q. What is the result of the following code?

Code:
let result = 3 + 2 * 4
print(result)
  • (A) 20
  • (B) 14
  • (C) 11
  • (D) 13
  • Correct Answer - Option(C)
  • Views: 1
  • Filed under category Swift (iOs)
  • Hashtags:

Explanation by: Admin
Multiplication has higher precedence, so 2*4=8, then 3+8=11.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.