Friday, 13 September 2013

How would I print the largest possible float and double in C?

How would I print the largest possible float and double in C?

For the following code,
#include <stdio.h>
#include <limits.h>
#include <float.h>
main() {
printf("double max = %??\n", DBL_MAX);
printf("double min = %??\n", DBL_MIN);
printf("double epsilon = %??\n", DBL_EPSILON);
printf("float epsilon = %??\n", FLT_EPSILON);
printf("float max = %??\n", FLT_MAX);
printf("float min = %??\n\n", FLT_MIN);
}
what specifiers would I have to use in place of the ??'s in order for
printf to display the various quantities as appropriately-sized decimal
numbers?

No comments:

Post a Comment