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

Code Challenge: Functions not working

Hello, I looked at other questions to see where my mistakes were. I cleaned up my original code, however I am still getting errors. Can someone show me what I am doing wrong?

Edit:

I tried posting a screenshot, I am not sure how to. Below I posted my code:

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

7 Answers

Hey Kieran, this worked for me:

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

Make sure the name of the function is spelled, and capitalized exactly how they ask.

UPDATE:

I figured out what my problem was. The function has to be named addTwo instead of addtwo. I guess I got a lot of practice figuring it out lol.

anyone know the answer to this one. I had something similar to the other post. Still doesn't work.

Here is what I have

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

doesn't work

Hey Kieran, you have to put the {return a + b; } in the squiggle brackets. Sorry for lack of term for the brackets.

No i figured it out. Thanks man!

What was the problem?