Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

C Language Examples - Output a double-precision (double) number

C Language Examples - Output a double-precision (double) number

C Language Examples C Language Examples

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 C Language Examples