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

General Discussion

First challenge, part 2 problem,...

I'm very new and this may be a very dumb question, if so I apologize but I'm really stuck... the code is supposed to say a ball with a radius of 14.5 inches and it's a float. This is what I have and it's obviously wrong but I can't figure out what to do to fix it...

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

Thanks for any help!

3 Answers

Hi Kathy,

I guess you want to use something like this: printf(" A ball with a radius of %f inches\n.", radius);

Where "%f" represents that the variable you are about to print (radius) is a float.

Hope it helps.

Hi Kathy,

Think of %f as a placeholder for your formatted number. %f specifies to display the number as a floating numeral. It should like something like the code below.

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

Thank you so much for your help, guys! This is all brand new to me and I feel like I've landed on another planet!