Answers for "difference between %e/E, %f/F and %g/G in program C"

C#
0

difference between %e/E, %f/F and %g/G in program C

void main(int argc, char* argv[])  
{  
        double a = 4.5;
        printf("=>>>> below is the example for printf 4.5n");
        printf("%%e %en",a);
        printf("%%f %fn",a);
        printf("%%g %gn",a);
        printf("%%E %En",a);
        printf("%%F %Fn",a);
        printf("%%G %Gn",a);
          
        double b = 1.79e308;
        printf("=>>>> below is the exbmple for printf 1.79*10^308n");
        printf("%%e %en",b);
        printf("%%f %fn",b);
        printf("%%g %gn",b);
        printf("%%E %En",b);
        printf("%%F %Fn",b);
        printf("%%G %Gn",b);

        double d = 2.25074e-308;
        printf("=>>>> below is the example for printf 2.25074*10^-308n");
        printf("%%e %en",d);
        printf("%%f %fn",d);
        printf("%%g %gn",d);
        printf("%%E %En",d);
        printf("%%F %Fn",d);
        printf("%%G %Gn",d);
}
Posted by: Guest on January-03-2022
0

difference between %e/E, %f/F and %g/G in program C

=>>>> below is the example for printf 4.5
%e 4.500000e+00
%f 4.500000
%g 4.5
%E 4.500000E+00
%F 4.500000
%G 4.5
=>>>> below is the exbmple for printf 1.79*10^308
%e 1.790000e+308
%f 178999999999999996376899522972626047077637637819240219954027593177370961667659291027329061638406108931437333529420935752785895444161234074984843178962619172326295244262722141766382622299223626438470088150218987997954747866198184686628013966119769261150988554952970462018533787926725176560021258785656871583744.000000
%g 1.79e+308
%E 1.790000E+308
%F 178999999999999996376899522972626047077637637819240219954027593177370961667659291027329061638406108931437333529420935752785895444161234074984843178962619172326295244262722141766382622299223626438470088150218987997954747866198184686628013966119769261150988554952970462018533787926725176560021258785656871583744.000000
%G 1.79E+308
=>>>> below is the example for printf 2.25074*10^-308
%e 2.250740e-308
%f 0.000000
%g 2.25074e-308
%E 2.250740E-308
%F 0.000000
%G 2.25074E-308
Posted by: Guest on January-03-2022

C# Answers by Framework

Browse Popular Code Answers by Language