what i coded is
#include <stdio.h>
int main(){
float a, b;
printf("enter initial value.");
fflush(stdout);
scanf("%f", &a);
printf("add up the following number.");
fflush(stdout);
scanf("%f", &b);
printf("current value is %f.\n", (a+b));
fflush(stdout);
b = a+b;
printf("enter a value to subtract.");
fflush(stdout);
scanf("%f", &a);
printf("current value is %f. \n", b-a);
fflush(stdout);
b = b-a;
printf("enter a value to multiply.");
fflush(stdout);
scanf("%f", &a);
printf("current value is %f. \n", a*b);
fflush(stdout);
b = a*b;
printf("enter a value to devide.");
fflush(stdout);
scanf("%f", &a);
printf("current value is %f. \n", b/a);
fflush(stdout);
return 0;
}
Output:
enter initial value. 1000000
add up the following number. 9000000
current value is 10000000.000000.
enter a value to subtract. 0
current value is 10000000.000000.
enter a value to multiply. 1000000
current value is 10000000000000.000000.
enter a value to devide. 10
current value is 999999982796.800050.
https://i.stack.imgur.com/xuqab.png
i want 1000000000000.000000 as a result but 999999982796.800050 is all i've got.... what should i fix?