Iam new to C and I have a problem with adding and printing some doubles in 09.3f format. This is my code:
#include <stdio.h>
int main(int argc, char **argv)
{
double d, m, c;
scanf("%1f", &d);
scanf("%1f", &m);
c = d + m;
printf("%09.3f\n", c);
}
And I have typed twice scanf
yet I can only insert 1 number, why is that?
what i get from the printf is 00000.000
Example: d = 5,125 and m = 1.256, then i want C to be: 00006.381