0

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?

tachyon
  • 43
  • 1
  • 7
  • 1
    This might answer your question https://stackoverflow.com/questions/4089174/printf-and-long-double. MinGW doesn't support that data type if I'm not wrong. –  Mar 31 '21 at 07:15
  • Or I think you can use the following `#define printf __mingw_printf` macro to get it "working". –  Mar 31 '21 at 07:17

1 Answers1

0

i guess in c mingw does not support long double datatype