[prog] functions

Wolf Rising wolfrising at gmail.com
Sun Dec 19 04:42:36 EST 2004


Thank you :-)

Both functions are working now:

//define function
float cel(float temp)
{
        return ((5.0 / 9.0) * (temp - 32));
}

//define function
float fahr(float temp)
{
        return (9.0 / 5.0 * temp + 32);
}

Thanks!!


On Sat, 18 Dec 2004 10:37:25 -0500, Marize Pommot-Maia
<marize at pommot.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Wolfgang Petzold wrote:
> | Am 12/18/2004 03:51 PM schrieb Marize Pommot-Maia:
> |
> |
> |>The correct formula is
> |>c = 5 *(f - 32)/9
> |
> |
> | ... and rearranging for f is left as an exercise for the reader. ;-)
> |
> | Regards,
> | Wolfgang
> 
> Well, if you insist ;-)
> 
> C: temperature in Celsius, F temperature in Fahrenheit
> 
> Given F, find C ==> C = 5*(F - 32)/9
> 
> Given C, find F ==> F = 9*C/5 + 32
> 
> 
> - --
> - ------------------------------------------------------------------------
>                                 Marize Pommot-Maia
>                                 marize at pommot.net
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.6 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFBxE614y2uvMn0AkcRAqczAKCX20oWREovmTqiylyKmuql6xJIIQCg3Yug
> qdlf8LLZyQpN+njmOqdkckg=
> =ij3Q
> -----END PGP SIGNATURE-----
> _______________________________________________
> Programming mailing list
> Programming at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/programming
>


More information about the Programming mailing list