this is a syntax i've been trying to run. apparently it stopped as i entered the first value.
can anyone check why this is happening?
this is the value i am trying to key in
Initial House Cost
67,000
62,000
75,000
Annual Fuel Cost
2,300
2,500
1,850
Tax Rate
0.025
0.025
0.020
my syntax are as below
Code:
#include <stdio.h>
#include <conio.h>
int main(void)
{
float houseInt1 , houseInt2 , houseInt3 ;
float fuelAnnual1 , fuelAnnual2 , fuelAnnual3;
float taxRate1 , taxRate2 ,taxRate3;
float total1 , total2 , total3;
printf("Enter the initial house cost for house number 1");
scanf("%f",houseInt1);
printf("Enter the Annual Fuel Cost for house number 1");
scanf("%f",fuelAnnual1);
printf("Enter the taxRate for house number 1");
scanf("%f",taxRate1);
printf("Enter the initial house cost for house number 2");
scanf("%f",houseInt2);
printf("Enter the Annual Fuel Cost for house number 2");
scanf("%f",fuelAnnual2);
printf("Enter the taxRate for house number 2");
scanf("%f",taxRate2);
printf("Enter the initial house cost for house number 3");
scanf("%f",houseInt3);
printf("Enter the Annual Fuel Cost for house number 3");
scanf("%f",fuelAnnual3);
printf("Enter the taxRate for house number 3");
scanf("%f",taxRate3);
total1 = houseInt1 + fuelAnnual1*5 + houseInt1*taxRate1*5;
total2 = houseInt2 + fuelAnnual2*5 + houseInt2*taxRate2*5;
total3 = houseInt3 + fuelAnnual3*5 + houseInt1*taxRate3*5;
printf("total cost of a house after a five-year period");
printf("house 1 = %f house 2 = %f house 3 = %f", total1, total2, total3 );
if (total1<=total2 && total1<=total3)
printf("best buy is house number 1 = %f", total1);
else if(total2<= total1 && total2<=total3)
printf("best buy is house number 2 = %f", total2);
else
printf("best buy is house number 3 = %f", total3);
return 0;
}
i'm stuck i don't know what to do....