You need to use L
flag (%Le
) to signify that you pass long double
:
printf("minimum long double positive value of %Le \n", LDBL_MAX);
printf("maximum long double positive value of %Le \n", LDBL_MIN);
Otherwise the original code gets part of the long double
from the stack and interprets it as double
which clearly becomes a mess.
12
solved c programming, not getting proper value of long double