Printing long double value with 19 digits after the decimal point in C language

1 Like

You can use %LF for long double format specifier in C, but to print the 19 digits after the point, we have to use ".19" before the format specifier, so it would be "%.19LF"
see the example…

#include <stdio.h>
int main(){
    long double x = 3.141592653589793213456;
    printf("%.19LF", x);
}
/*
Output:
3.1415926535897931160
*/
1 Like