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 trial

iOS Swift 2.0 Functions Function Parameters Function Parameters

Durus Mihai
Durus Mihai
2,660 Points

A function for remainder not working

I really don't get whats wrong in my code, i need some help, ty!

functions.swift
// Enter your code below
func getRemainder (a value: Int, b divisor: Int) -> Int
{
return a % b
}

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! You're very close here. So I'm just going to give some hints. The function of the definition should have two parameters of type Int with an external name and an internal name. The external names are value and divisor. The internal names are a and b. The external names should be written first and then the internal names. You've gotten this part backwards. Try changing the order here.

I think you can get it with this hint, but let me know if you're still stuck! :sparkles:

Durus Mihai
Durus Mihai
2,660 Points

Oh:)), now i understand why it kept giving me errors, ty ?