A Long double variable results in a negative number when a value is assigned

73 Views Asked by At

The issue I am having is that when I define a variable n as long double and set the value to 5 when i run it to print the value of n it prints -0.0000. I'm trying to achieve a larger range of numbers so i decided to switch from double to long double. OS: windows 10 IDE: Code blocks compiler: mingw32-gcc.exe

long double n;
n=5;
printf("n= %Lf\n",n);
0

There are 0 best solutions below