S
Sathyaish
In C, what do you use to store numbers larger than the floating point
range? For e.g, consider the code below:
int main(void)
{
float a = 0.0;
double b = 0.0;
double f = 0.0;
a = 123456789.0;
printf("%f\n\n", a); //output: 123456792.000000
b = 123456789;
printf("%f\n\n", b); //output: 123456789.000000
printf("Enter a number: ");
scanf("%f", &f); //input: 123456789
printf("You entered: %f\n\n", f); //output: 0.000000
return 0;
}
What datatype should be used to negate the rounding error?
range? For e.g, consider the code below:
int main(void)
{
float a = 0.0;
double b = 0.0;
double f = 0.0;
a = 123456789.0;
printf("%f\n\n", a); //output: 123456792.000000
b = 123456789;
printf("%f\n\n", b); //output: 123456789.000000
printf("Enter a number: ");
scanf("%f", &f); //input: 123456789
printf("You entered: %f\n\n", f); //output: 0.000000
return 0;
}
What datatype should be used to negate the rounding error?