Code:
#include <stdio.h>
double fiveycost(double house, double fuel_cost, double tax_rate);
int main()
{
printf("This program determines the total cost of owning a home for five years.\nThe user will enter initial cost in whole dollars, annual fuel costs in whole dollars, and the annual tax rate as a real number.\n");
printf("Please enter the initial cost, fuel cost, and tax rate: ");
double house;
double fuel_cost;
double tax_rate;
scanf("%lf %lf %lf", &house,&fuel_cost,&tax_rate);
(Line 13) printf(" The total cost is $%lf.",fiveycost);
return 0;
}
double fiveycost( double house, double fuel_cost, double tax_rate)
{
double taxes=(house*tax_rate);
return (5.0*taxes)+(house)+(5.0*fuel_cost)
}
The error is on line 13
:Warning: format '%lf' expects argument of type 'double', but argument 2 has type 'double (*)(double, double, double)' [-Wformat]
Not so sure why its showing an error. I mean i changed integer 5 to 5.0.
I declared everything as double.