I have multiplied 34e10 of float datatype with 10 and I got the result as 3400000077824.000000
#include <stdio.h>
int main()
{
float a=34e10;
a*=10;
printf("%f",a);
return 0;
}
I have also tried by making the 10 as a variable called b of type float and got the same answer
But when I use double as a datatype I get the correct answer as 3400000000000.000000
#include <stdio.h>
int main()
{
double a=34e10;
//double b=10;
a*=10;
printf("%f",a);
return 0;
}
Someone please explain the problem to me please