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 Objective-C Basics (Retired) Functional Programming in C Functions

Functions challenge

Ok, why is this not working...?

float addTwo(float a, float b) { return a + b; }

8 Answers

Florian Neveu
Florian Neveu
2,383 Points

I'm in the same case... I don't understand ):

Samantha Tyson
Samantha Tyson
384 Points

Is there a way to skip the challenge? I just want to go to the next section.

Holger Liesegang
Holger Liesegang
50,595 Points

Amit Bijlani

I just tested this:

float addTwo(float a, float b)  {
    return a + b;
}

(and a few IMHO other correct versions) in https://teamtreehouse.com/library/functions Challenge task 1 of 1 of


Implement a function named "addTwo" that returns the sum of two floats. The function will accept two float numbers as arguments and return a float which is the sum of the two arguments passed to the function. (No need to write the main function just write out the implmentation for the addTwo function)


and it gives the error message: "Bummer! Make sure you've defined the return type and both paramter types as 'float' and that you are returning the sum of the arguments as a result."

Maybe there's something wrong with this challenge at the moment...

Kind Regards Holger

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

This challenge was broken due to some recent changes but it should work now. Sorry for the inconvenience.

There must be something wrong with that section... hmm

Florian Neveu
Florian Neveu
2,383 Points

Of course, return on the track (https://teamtreehouse.com/tracks/ios-development) and select the next step !

Samantha Tyson
Samantha Tyson
384 Points

Thanks. Of course that makes sense.

Henry Moran
Henry Moran
10,516 Points

So is this right? I'm stuck with this challenge for the moment...

float addTwo(float a, float b){
    return a + b;
}