You should use the corresponding format specifiers for the values that you are trying to print, e.g., the type of the result of sizeof is an unsigned integer, so you should either use %zu, or if you must compile with respect to an older version of the C standard, use %u then cast the result of sizeof to unsigned int. Likewise, for printing long double you should use %Le instead of %e:
Code:
#include <float.h>
#include <stdio.h>
int main(void) {
long double r;
printf("sizeof(float) %zu\nsizeof(double) %zu\nsizeof(long double) %zu\n",
sizeof(float),
sizeof(double),
sizeof(long double));
printf("FLT_MAX %e\nDBL_MAX %e\nLDBL_MAX %Le\n",
FLT_MAX,
DBL_MAX,
LDBL_MAX);
r = 1.1L + 1.2L;
printf("r=1.1L+1.2L;\nr=%Le\n", r);
}
Notice that instead of using %s as a placeholder and then supplying the text as arguments to printf, I embedded the text directly in the format string. This is the usual approach for readability.