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 trialFILIPE FALCAO
708 PointsIs my code wrong? In Xcode works
int main() { float addTwo(float a,float b);
float a = 2.5; float b = 2.5; float result = addTwo(a,b); printf("%f \n", result); return 0; }
float addTwo(float a,float b) { return a + b ; }
3 Answers
Stone Preston
42,016 Pointsthe challenge says not to include main and only implement the function. your code is correct, but the challenge only wants the implementation.
all you need is
float addTwo(float a,float b) { return a + b ; }
John Carr
Courses Plus Student 1,984 Pointsaddtwo should be declared before int main, have a look back over the videos if unsure.
FILIPE FALCAO
708 PointsGot it, sorry but my english is not perfect. If youΒ΄re thinking of translating the courses to Portuguese ( portugal, brasil) let me know :) Apart of that ... all fantastic!
John Carr
Courses Plus Student 1,984 PointsJohn Carr
Courses Plus Student 1,984 Pointsi should have looked at the question :-P