Neophyte seeks scanf() help
Howard Huang
huang at husc8.harvard.edu
Tue Mar 12 11:17:14 AEST 1991
>float get_tax(void)
>{
> float tax;
>
> printf("Enter the tax: ");
> scanf("%f", &tax);
> printf("The tax is %.4f\n", tax);
>
> return tax;
>}
>
>Running it produces the following:
>Enter the tax: 0.01
>The tax is 0.1000
That looks like a bug in your compiler...
Some earlier versions of Symantec's THINK C have this funny scanf
bug. I'm sure you could call Symantec and ask them how to fix the
bug, or maybe you can find something on one of the Mac ftp sites
(sumex.stanford.edu).
--
----------------------------------------------------------------------------
Howard C. Huang Internet: huang at husc9.harvard.edu
Junior Computer Science Major Bitnet: huang at husc9.BITNET
Mather House 030, Harvard College UUCP: huang at husc9.UUCP (I think)
Cambridge, MA 02138 Apple II: ftp husc6.harvard.edu
More information about the Comp.lang.c
mailing list