C Language Examples - Output a double-precision (double) number
Use printf() and %e to output a double-precision number.
Example
#include
<
stdio.h
int
main
(
)
{
double
d;
// Declare a double-precision variable
d
=
12
.001234
;
// Define a double-precision variable
printf
(
"
The value of d is %le
"
,
d
)
;
return
0
;
}
Output result:
d 的值为 1.200123e+01
C Language Examples