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) Fundamentals of C Variables

Zachary Roark
Zachary Roark
66 Points

%f = Float Radius 14.5??? Or does it?

Hello there,

I am having issues with the challenge part 2 of 2. When it asks to write "A ball with the radius of 14.5 inches" I thought it wants you to write %f, to indicate the 14.5 from the float radius line/challenge before, but when I do that and check the work, it says that it does not work.

Is there something I am missing? I have tried everything else I could think of and nothing has worked so far.

Thank You!

2 Answers

You probably forgot to include the variable you wanted to use.

printf("A ball with the radius of %f inches.\n", radius);

%f won't do anything if you forget to include the variable outside the string :) Hope that works!

Zachary Roark
Zachary Roark
66 Points

Now it makes sense. I didn't really understand the purpose of the radius variable at the end until you showed me. Thank you!

Hey Zach, here's the answer.

float radius = 14.5;
printf("A ball with a radius of %f inches.", radius);