delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/05/09:40:09

From: "Jason Yip" <manman AT netteens DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Why the value of "c" is always "-17.78"??
Date: Sun, 5 Dec 1999 13:33:52 +0800
Organization: netteens.net (Hongkong Telecom IMS)
Lines: 27
Message-ID: <82ctj1$i7b$1@imsp026.netvigator.com>
NNTP-Posting-Host: olkc10216.netvigator.com
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Can anyone tells me why the value of "c" is always -17.78??
Thank a lot!!

#include <stdio.h>
float ftc(n)
int n;
{
float c, f; int i;
 for (i=0;i<=n;i++){
 c=5.0/9.0*(f-32);
        }
return c;
}
main ()
{
float c, f=0; int i=0;
do
{
c=ftc(i);
printf("\t\t F=%.2f \t\t C=%.2f\n",f,c);
f++;
i++;
} while (i<=100);
}



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019