A

Admin • 670.22K Points
Coach

Q. What is the result of the following code?

Code:
let a = 5
let b = 2
let result = a % b
print(result)
  • (A) 2
  • (B) 0
  • (C) 1
  • (D) 5
  • Correct Answer - Option(C)
  • Views: 1
  • Filed under category Swift (iOs)
  • Hashtags:

Explanation by: Admin
`%` operator returns the remainder. 5 % 2 = 1.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.