Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!samsung!spool.mu.edu!cs.umn.edu!kirchner From: kirchner@umn-cs.cs.umn.edu (Roger B. Kirchner) Newsgroups: comp.sys.next Subject: Problem reading float with %g Message-ID: <1991Apr11.130707.1461@cs.umn.edu> Date: 11 Apr 91 13:07:07 GMT Sender: kirchner@cs.umn.edu (Roger B. Kirchner) Organization: University of Minnesota, Minneapolis, CSci dept. Lines: 21 Can anyone explain why I can't seem to read in a float value using %g? localhost> cat test.c main() { double x, y, z; printf("Enter three floats: "); scanf("%le %lf %lg", &x, &y, &z); getchar(); printf("%e %e %e\n", x, y, z); } localhost> cc test.c localhost> a.out Enter three floats: 3.14 3.14 3.14 3.140000e+00 3.140000e+00 6.366020e-314 localhost> Thanks. Roger Kirchner rkirchne@mathcs.carleton.edu