A

Admin • 833K Points
Coach

Q. What will this Swift code output?

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

Explanation by: Admin

7 % 3 equals 1, which is the remainder of the division.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.