Writing Functions

I need help to write functions returning the fahrenheit value of a celcius temperature, and another one that does the opposite.

Thank you for helping
So... something like this?

1
2
3
4
5
6
7
8
9
10
double FtC(double F) {
    double C;
    //TODO: Write the implementation.
    return C;
}
double CtF(double C) {
    double F;
    //TODO: Write the implementation.
    return F;
}


Sorry, but I don't think it's a good idea for me to write any more of those functions. That'd take away all the fun. :D

-Albatross
Thank you Albatross!
What if I want to use the "float" instead "double", would that make any difference?
Yes. You would have to replace double with float in the code above.
Last edited on
Topic archived. No new replies allowed.