Basically the program intakes two numbers and subtracts them. The reimbursement($) would then be multiplied by .35
(Standard stuff)
double OD1
double OD2
printf("Enter beginning odometer reading")
scanf("%lf", &OD1)
printf("Enter ending odometer reading")
scanf("%lf", &OD2)
double diff= OD2-OD1;
double reimbursement= rate*diff
print("You traveled %lf amount of miles At $.35 per mile, your reimbursement is %lf",diff,reimbursement)
The program works if i enter whole numbers/integers. But as soon as i put in a decimal it crashes and it doesn't work.
Why is that? I have doubles declared. I have %lf in the scanf function..