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

I am stuck on Question 2 of the Variables Section in the C Basics section. Floating variable

Am I doing this wrong? Trying to get the phrase "A ball has a radius of 2.45 inches".

float radius=2.45

printf("A ball has a radius of %f inches.\n")

1 Answer

Hannah Gaskins
Hannah Gaskins
14,572 Points

Hey there,

I just started iOS dev with Objective C too!

When I was on that task this is what worked for me:

float radius = 2.45;

printf ("A ball with a radius of %f inches", radius);

Where you declare the variable again after the printf "" statement.

Hope this helps!

Thank you!!!