printf()
can use either %f
or %lf
.
printf
is transmitted by converting float
to double
before receiving float
There are two format specifiers for double
instead of no format specifiers for float
.
However, this applies only to outputs such as printf()
and not to inputs such as scanf
and fscanf
.
In the input, %f
means to read float
, %lf
means to read %Lf
, and %Lf
means to read long double
© 2024 OneMinuteCode. All rights reserved.