Printing long double data

How can i print long double data type in c..Here %llf or %Lf is not working in my code?
%Lf should work:
1
2
3
4
5
6
7
8
#include <stdio.h>

int main()
{
    long double d = 1.23456789;
	printf("%Lf",d);
	return 0;
}
http://ideone.com/os9LGr
This Programme is showing this output to me....

-0.000000
Process returned 0 (0x0)
Press any key to continue.
Which compiler do you use? I remember that Microsoft one lacked proper support for long doubles in standard library, so if you use that you might want to switch compilers or upgrade.

EDIT: If you use GCC: http://stackoverflow.com/questions/7134547/gcc-printf-and-long-double-leads-to-wrong-output-c-type-conversion-messes-u
Upgrade your MinGW installation.
Last edited on
Topic archived. No new replies allowed.