/* C program that writes a small decimal value to a file */
#include <stdio.h>
int main(void)
{
FILE * fout;
double a;
fout = fopen("myFile.txt", "w");
a = -0.00283527374267578125;
fprintf(fout, "Here is what I print ... \n");
fprintf(fout, "%.25f \n", a);
fprintf(fout, "%.30f \n", a);
fprintf(fout, "%.25lf \n", a);
fprintf(fout, "%.30lf \n", a);
fclose(fout);
}
/* The output results of the C program */
-0.0028352737426757813000000
-0.002835273742675781300000000000
-0.0028352737426757813000000
-0.002835273742675781300000000000
Best Answer