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
Chelcie Small
81 Pointsvariables
Any help please!? Link : http://teamtreehouse.com/library/variables-2
I started out with this: float radius = 14.5; printf("A ball with a radius of %f inches\n", radius);
And this is what the system keeps saying:
Bummer! Make sure you are passing a string instead of a NSString to printf. Also, make sure you have the correct format options. (%f is used for floats)
3 Answers
Gunjeet Hattar
14,483 PointsI copy pasted your answer and just got 12 points on the go, thats when I haven't started with Objective -C yet. Works fine for me without any error :)
for first float radius = 14.5;
for second
printf("A ball with a radius of %f inches\n", radius);
= +12 points
roddutra
2,703 PointsYour answer looks right to me, although it should be in two separate lines. One you have used the semi-colon you can't have any other statements after it on the same line...
eg:
float radius = 14.5; printf("A ball with a radius of %f inches\n", radius);
Stone Preston
42,016 Pointsactually I believe you can have as many statement on one line as you want, just as long as your syntax is correct and you end each statement with a semi colon. The compiler doesnt take into account white space and line breaks.
RASHU BHATNAGAR
Courses Plus Student 2,669 Pointshere is the code editor is expecting: float radius=14.5; printf("A ball with a radius of %f inches",radius);
you actually addedd \n in the end of the quotes which the editor is not expecting and thats why a bummer happened. You need to do exactly what the question is asking and nothing less or nothing more and then only it will let you pass.
Chelcie Small
81 PointsChelcie Small
81 PointsThanks Gunjeet!
Gunjeet Hattar
14,483 PointsGunjeet Hattar
14,483 PointsGlad I could help. See you around!