c语言中打印浮点数
c语言中打印浮点数。
#include <stdio.h> int main(void) { float f = 100.0; double d = 1.0e2; long double ld = 1.0e2; printf("float: %f.\n", f); printf("float: %e.\n", f); printf("float: %E.\n", f); printf("float: %a.\n\n", f); printf("double: %f.\n", d); printf("double: %e.\n", d); printf("double: %E.\n", d); printf("double: %a.\n\n", d); printf("long double: %Lf.\n", ld); printf("long double: %Le.\n", ld); printf("long double: %La.\n", ld); return 0; }