Search code examples
cwindowsgcclong-double

long double input to scanf


I am using windows 10 and MinGW-x64 gcc 8.1.0. I was trying to take a long double as input using scanf. Here is the code:

#include<stdio.h>
#include<stdlib.h>

int main(int argc, char const *argv[])
{
    long double a;
    scanf("%Lf",&a);
    printf("%Lf",a);

    return 0;
}

the output on the console is 0.000000. Why is that so? Is it a windows issue?


Solution

  • i guess in c mingw does not support long double datatype