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

Need help in the variables section

float radius = 14.5;

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

My code doesn't work and i can't passed the quiz

variable_assignment.mm
float radius = 14.5;

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

2 Answers

Ludwing Najera
Ludwing Najera
4,596 Points

it's because the computer doesn't know what the float is called. look,

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

I inputted the code and it still din't work.

Ludwing Najera
Ludwing Najera
4,596 Points

That's wierd, because i put that in the code challenge and it worked

The code was printf("14.5;A ball with a radius of %f inches.",radius); Thanks for the help anyways, you just gave me the wrong format.