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

Michael Sevy
Michael Sevy
3,167 Points

variable_assignment

cannot get past this exercise, what am i doing wrong? thanks Justin

{ float radius = '14.5'; printf("%f is the radius.\n", radius);

return 0;

}

Justin Horner
Justin Horner
Treehouse Guest Teacher

Hello Michael,

Would you post your code? I'd be glad to help.

3 Answers

Michael Sevy
Michael Sevy
3,167 Points
{
    float radius = '14.5';
    printf("%f is the radius.\n", radius);

    return 0;
}
Justin Horner
STAFF
Justin Horner
Treehouse Guest Teacher

Hello Michael,

Thanks for posting your code.

In this case, the challenge does not expect you to add brackets or a return value so you can remove those. Next, your float variable should be a float value without single quotes. You define a float as follows.

float variableName = 10.5;

Lastly, the challenge is expecting a very specific message. Change your print message so it will output "A ball with a radius of 14.5 inches". Also note, you don't need a new line return at the end so you should remove the "\n".

I hope this helps! If you need any further help or explanation please feel free to ask :)

Michael Sevy
Michael Sevy
3,167 Points

Awesome, thanks so much!