| www.delorie.com/archives/browse.cgi | search |
| From: | chris_mears AT softhome DOT net (Chris Mears) |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Why "c" is always zero?? |
| Organization: | CHOAM |
| Message-ID: | <384b3c27.2499423@news.bigpond.com> |
| References: | <82cko6$sfk$1 AT imsp026 DOT netvigator DOT com> <8bn24.1599$323 DOT 42573 AT dfiatx1-snr1 DOT gtei DOT net> |
| X-Newsreader: | Forte Agent 1.5/32.452 |
| MIME-Version: | 1.0 |
| Lines: | 34 |
| Date: | Sun, 05 Dec 1999 10:20:24 GMT |
| NNTP-Posting-Host: | 139.134.198.67 |
| X-Trace: | newsfeeds.bigpond.com 944388925 139.134.198.67 (Sun, 05 Dec 1999 21:15:25 EST) |
| NNTP-Posting-Date: | Sun, 05 Dec 1999 21:15:25 EST |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
On Sun, 05 Dec 1999 05:59:32 GMT, "Damian Yerrick"
<NOSP AT Musenet@pineight.8m.com> wrote:
[snip]
>
>try this
>
>#include <stdio.h>
>float fahren2celsius(float fahren)
>{
> return 5/9 * (fahren - 32.);
^^^
Almost.
5.0/9.0
>}
>
>int main()
>{
> int i;
> float fahren, celsius;
>
> for(i = 0; i < 212; i++)
> {
> fahren = i;
> celsius = fahren2celsius(fahren);
> printf("%f deg F = %f deg C\n", fahren, celsius);
> }
>
> return 0;
>}
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |