> What am I doing wrong?
Dunno, you need to post more information about what you did.
This for example seems to work for me.
Code:
#include <stdio.h>
int main() {
double d;
scanf("%lf",&d);
printf("d=%f\n", d);
return 0;
}
$ gcc -W -Wall foo.c
$ ./a.exe
3.0e-5
d=0.000030
But if you were expecting to see 3.0e-5 printed, then you need to look up what the "%e" and "%g" formats also do. printf() has many ways of controlling how floating point numbers are printed.
> but what about double?
As shown, use "%f" for printing, and "%lf" for scanning.