www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/04/23:14:19

From: "Jason Yip" <manman AT netteens DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Why "c" is always zero??
Date: Sun, 5 Dec 1999 11:03:01 +0800
Organization: netteens.net (Hongkong Telecom IMS)
Lines: 66
Message-ID: <82cko6$sfk$1@imsp026.netvigator.com>
NNTP-Posting-Host: olkc10238.netvigator.com
Mime-Version: 1.0
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

This is a multi-part message in MIME format.

------=_NextPart_000_000A_01BF3F10.4C15FFC0
Content-Type: text/plain;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

Can anyone tells me why the value of "c" is always equal to zero??
How can I correct this?
Thanks a lot!!

#include <stdio.h>
float ftc(n)
int n;
{
float c, f; int i;
 for (i=3D0;i<=3Dn;i++){
 c=3D5/9*(f-32);
        }
return c;
}
main ()
{
float c, f=3D0; int i=3D0;
do
{
c=3Dftc(i);
printf("\t\t F=3D%.2f \t\t C=3D%.2f\n",f,c);
f++;
i++;
} while (i<=3D100);
}


------=_NextPart_000_000A_01BF3F10.4C15FFC0
Content-Type: text/html;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dbig5" http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3D"Times New Roman">Can anyone tells me why the value of =
"c" is=20
always equal to zero??</FONT></DIV>
<DIV><FONT size=3D2>How can I correct this?</FONT></DIV>
<DIV><FONT size=3D2>Thanks a lot!!</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Times New Roman">#include &lt;stdio.h&gt;<BR>float=20
ftc(n)<BR>int n;<BR>{<BR>float <FONT color=3D#0000ff>c</FONT>, f; int=20
i;<BR>&nbsp;for (i=3D0;i&lt;=3Dn;i++){<BR>&nbsp;<FONT=20
color=3D#0000ff>c=3D5/9*(f-32)</FONT>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
}<BR>return c;<BR>}<BR>main ()<BR>{<BR>float c, f=3D0; int=20
i=3D0;<BR>do<BR>{<BR><FONT color=3D#0000ff></FONT><FONT=20
face=3D"Times New Roman">c=3Dftc(i);<BR></FONT></FONT><FONT=20
face=3D"Times New Roman">printf("\t\t F=3D%.2f \t\t C=3D%.2f\n",f,<FONT=20
color=3D#0000ff>c</FONT>);<BR>f++;<BR>i++;<BR>} while=20
(i&lt;=3D100);<BR>}<BR></FONT></DIV></BODY></HTML>

------=_NextPart_000_000A_01BF3F10.4C15FFC0--

- Raw text -


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