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

Lucy H
Lucy H
210 Points

%f entered incorrectly?

Hi this is silly since I'm only in Stage one, but I can't understand why this is incorrect when %f is to float and that is what I have entered.

variable_assignment.mm
float radius = 14.5;
printf("A ball with a radius of %f inches");

2 Answers

Chris Shaw
Chris Shaw
26,676 Points

Hi Lucy,

You have a few issues with your formatter which are as follows:

  1. The task requires you start the formatter with A, you have The
  2. You have /n at the end of your string, instead you should have a space and inches
  3. You're not passing the variable radius to your printf declaration
printf("A ball with a radius of %f inches", radius);

Happy coding.

Lucy H
Lucy H
210 Points

On jeez thanks. Very new at this.

Chris Shaw
Chris Shaw
26,676 Points

No worries, please ask as many questions as you like as there's plenty of people waiting to assist with you.