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

Ammar Zafar
Ammar Zafar
196 Points

How do I create a float variable named 'radius' with the value '14.5' without writing the main function).

I'm having trouble understand this for some reason. Every variation I try I am always having one error. I think it should go like this int radius = 14.5; float = radius;

float = radius;

1 Answer

Hi Ammar,

This can be done as:

float radius = 14.5f;
Ammar Zafar
Ammar Zafar
196 Points

Thank you but why is there a f after 14.5