|
From: Titi A. <tia...@ya...> - 2006-02-24 02:37:57
|
Hi all,
I tried the following code
============================
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
main(){
double a,b;
scanf("%f",&a);
printf("\n");
scanf("%f",&b);
printf("\n\n%f %f",a,b);
getch();
exit(EXIT_SUCCESS);
}
==============================
I enter any numbers and the output is
0.0000 0.00000
but, when I change the "double" with "float", the code
gives me the right answer.
Is there any explanation why I can't use "double" with
"%f" in dev-cpp ? Maybe I use old c++ manual lol. How
can I print the "double" number ?
Titi
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|