Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAditya Gawade
1,182 Pointshaving problem with calling the function
Now that we have a working function let's use it.
Call the function and pass in a value of 10 for the first parameter and 3 for the second.
Assign the result of the function operation to a constant named result.
// Enter your code below
func getRemainder( value a: Int, divisor b: Int) -> Int {
return a%b
}
let result = getRemainder(10, b:3)
2 Answers
David Lin
35,864 PointsBecause the function's input parameters have external names, you need to use them in the call. For example:
// Enter your code below
func getRemainder(value a: Int, divisor b: Int) -> Int {
return a%b
}
let result = getRemainder(value: 10, divisor: 3)
Aditya Gawade
1,182 Pointsthank u david. that was helpful
Aditya Gawade
1,182 PointsAditya Gawade
1,182 Pointsthank you. also i wanted to ask that if the iOS course on treehouse is enough to start making apps?
David Lin
35,864 PointsDavid Lin
35,864 PointsYou're welcome, Aditya! Yes, there's several courses in the iOS track where you build complete apps from scratch, so that will help give you a lot of experience and practice.