+ 2
Popsicles help
Help, I don't know what to do here. It keeps giving me errors. var popsicles = Int(readLine()!) var siblings = Int(readLine()!) if popsicles % siblings == 0 { print("give away") } else { print("eat them yourself") } How do I make an int user input?
3 Answers
+ 6
You need to declare both variables as follows:
var siblings:Int
var popsicles:Int
Further you need to add exclamation mark at end of these two statements.
siblings = Int(readLine()!)!
popsicles = Int(readLine()!)!
+ 2
ÄrtÄmī§ you are welcome
+ 1
Thanks Swapnil