Xref: utzoo comp.sys.mac.programmer:22385 comp.lang.c:36813 Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!uwm.edu!spool.mu.edu!samsung!usc!nic.csu.net!beach.csulb.edu!csus.edu!wuarchive!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!fcom.cc.utah.edu!npd.novell.com!newsun!chandler From: chandler@kinetics.com (Mark Chandler) Newsgroups: comp.sys.mac.programmer,comp.lang.c Subject: Neophyte seeks scanf() help Keywords: scanf think c help Message-ID: <1991Mar4.233141.29874@novell.com> Date: 6 Mar 91 02:19:19 GMT Sender: news@novell.com ( Followup-To: poster Lines: 36 The News Manager) Nntp-Posting-Host: plasma Organization: Novell, Walnut Creek CA. Distribution: na Date: Mon, 4 Mar 1991 23:31:41 GMT I just started a C programming class a few weeks ago and have run into a problem that I can't figure out. I have a *very* simple funtion that prompts the user to input a number and then echoes it back. The function is: 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 ^^^^^^ Can someone explain what's going on here? I'm running THINK C v4.02 with the TCL, scanf(), and color.h updates on a Mac IIsi. *Any* help is greatly appreciated. Mark Chandler | The opinions expressed above chandler@wc.novell.com | are mine, not my employer's.