0
#include<stdio.h>
        
int main()
{
    float first=9876543210987654321.987654321;
    double second=9876543210987654321.987654321;
    long double a=9876543210987654321.987654321;
            
    printf("1=%f",first);
    printf("\n2=%lf",second);
    printf("\n3=%Lf\n\n",a);
    return 0;
}

help me please see the result in the pic attached noob coder xD

its the code result i get

  • Unrelated? the value in the `a` line has type `double`: you want `3.1415L` (or that big monster above) with the `L` suffix. – pmg Jan 22 '21 at 14:20
  • 1
    No images of code / output please always paste it directly in the question. – TheEagle Jan 22 '21 at 14:21
  • 2
    You're using a library that doesn't support long doubles with `Lf`. If you're using MinGW you need to do some tricks. Blame Microsoft. – Antti Haapala -- Слава Україні Jan 22 '21 at 14:25
  • What did you expect to get? – Robert Columbia Jan 22 '21 at 14:27
  • You could try your luck with `#define __USE_MINGW_ANSI_STDIO 1` before `#include`ing `` – Antti Haapala -- Слава Україні Jan 22 '21 at 14:27
  • *You're using a library that doesn't support long doubles with Lf.* Which is an extremely hard thing to search for and find the correct answer to, especially for someone new to C. You pretty much have to know the problem in order to search for the fix, and if you know the problem you'd know the fix already. I really don't know why questions like this get downvoted so quickly - it's a problem that a new C programmer isn't going to be able to solve. – Andrew Henle Jan 22 '21 at 14:29
  • @AndrewHenle is it though? "Long double printf wrong value" to google? – Antti Haapala -- Слава Україні Jan 22 '21 at 14:32
  • The `printf` in current versions of Microsoft C runtime libraries seems to map both `%lf` and `%Lf` to `long double` arguments, which is non-standard because `%f` and `%lf` are both supposed to map to `double` arguments. – Ian Abbott Jan 22 '21 at 14:34
  • @anttiHaapala its given in text book of mine – Kevin Shah Jan 22 '21 at 14:35
  • 1
    @AnttiHaapala When I Google that, I get mostly results from using the wrong format - a self-professed "noob" looking through those answers is likely to give up if they don't happen to find the one that fits after about 10-15 that don't help. The questioner here took the time to create a full MCVE, so a good bit of effort was put into the question, implying a good bit of research trying to find the correct answer. You really have to know what you're looking for to see the solution to a lot of problems in C, and I think those of us experienced in C have a tendency to forget that - I know I do. – Andrew Henle Jan 22 '21 at 14:39
  • @AndrewHenle can u help me out? – Kevin Shah Jan 22 '21 at 14:46
  • @KevinShah Assuming you are using MinGW on Windows, I really don't have any experience using `long double` there. And if you are on Windows, you have to remember the C runtime is not C99 compliant even with the 21st century more than 20% over, so support for later C features like `long double` is going to be sketchy. – Andrew Henle Jan 22 '21 at 14:53
  • 1
    @KevinShah [You could try your luck with #define __USE_MINGW_ANSI_STDIO 1 before #includeing ](https://stackoverflow.com/questions/65846773/writing-in-c-when-i-use-the-long-double-it-gives-me-0-000000-printing-value?noredirect=1#comment116422331_65846773) – Antti Haapala -- Слава Україні Jan 22 '21 at 15:48

0 Answers0