problem with functions

This is a discussion on problem with functions within the C Programming forums, part of the General Programming Boards category; Hey guys! im having some problems with functions. Just started going over them today in class and i was doing ...

problem with functions

Hey guys! im having some problems with functions. Just started going over them today in class and i was doing great throughout the semester until now! totally lost and confused! we were asked to make a program that contains 10 different functions for conversion and i cant even figure the first one out! This is what i have so far but i cant seem to get it to compile correctly...

In addition to Salem's correction - You're printing the result twice. Either print the message within the function, or after the function has been called. (If you're returning a value from the function, then you probably want the latter.)

So what exactly is your correction Salem? Thanks matticus, ill remove it from the function :-)

Look at the two lines in red in my post #3 above.
The one inside the function is correct, matching the %f format specifier with the variable "output."
The one in the switch statement is not correct, as you don't have a variable called "milesToKilo."

You can use the "milesToKilo()" function (with parenthesis) in the "printf()" statement also.