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

lina Hernandez
lina Hernandez
4,583 Points

Create Float

Would this be the appropriate solution

include <stdio.h>

int main() } float radius =14.5; printf; return 0; }

4 Answers

Marwi M
Marwi M
1,411 Points

not sure it will work .. to get the printf to work , it should be in the proper syntax.

printf("text to be printed , the variable value to be printed %f", variable ); // if variable value was 14.5 the above instruction will result in : text to be printed , the variable value to be printed 14.5

hope this will help you ..

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

For the first task all you need is float radius =14.5;. And as the instructions state you should leave out the main function as that is implied.

int main() {
 float radius = 14.5; 
 printf(radius); 

return 0; 
}

Or you could use a double

William Baker
William Baker
2,485 Points

You don't need to have the int main() or the return 0. Also, try only post in the forums if you keep getting stuck on one bit :)