Re: scanf to handle double
- From: "Mike Wahler" <mkwahler@xxxxxxxxxxxx>
- Date: Thu, 03 Nov 2005 02:32:40 GMT
"Red Dragon" <tskhoon@xxxxxxxxxxxx> wrote in message
news:43697449_2@xxxxxxxxxxxxxxxxx
> Can someone please tell me how I should write scanf to handle double?
> This program works fine for float a but not double a, as the print
> result at end of program illustrates.
> Thanks
> Khoon
>
> #include <stdio.h>
>
> int main (void)
> {
> double a;
> a =2.1111;
>
> printf ("Enter a> ");
> scanf ("%f", &a);
scanf("%lf", &a);
-Mike
.
- Follow-Ups:
- Re: scanf to handle double
- From: Red Dragon
- Re: scanf to handle double
- References:
- scanf to handle double
- From: Red Dragon
- scanf to handle double
- Prev by Date: Re: How is a compiler written
- Next by Date: Re: beginner c questions
- Previous by thread: scanf to handle double
- Next by thread: Re: scanf to handle double
- Index(es):
Relevant Pages
|