Forums
Learn
Careers
Store
About
SUBSCRIBE
UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>
Question 1/6: Which of these make result an integer equal to 5?
result
Hint: The % operator calculates division remainder Click to show.
%
Option 1:
var result = 11 % 6
11 divides into 6 once, leaving remainder 5.
Option 2:
var result = 2 + 2 + 1.0
This will create a double, not an integer.
Correct!
Oops – that's not correct.
Return to Review Menu
You are not logged in
Link copied to your pasteboard.