I am trying to figure out what I'm doing wrong with this code to keep getting errors, its a simple trip planner for a class I am taking however it will not compile and is giving me these errors:
C:\Documents and Settings\Justin\Desktop\trip.c In function `main':
24 C:\Documents and Settings\Justin\Desktop\trip.c syntax error before "printf"
26 C:\Documents and Settings\Justin\Desktop\trip.c syntax error before "scanf"
27 C:\Documents and Settings\Justin\Desktop\trip.c [Warning] passing arg 1 of `printf' makes pointer from integer without a cast
At top level:
29 C:\Documents and Settings\Justin\Desktop\trip.c syntax error before numeric constant
Here is my full code
//Name: Justin Hooker
//Assignment: Lab 2
//Date Written: July 10th 09
//Course: CS133U
//Program: trip.c
//Purpose: Trip Planner
#include <stdio.h>
#include <stdlib.h>
int main()
{
int fuel, mpg, miles, fuelr;
printf("Enter Price of Fuel per gallon.");
scanf("%f",&fuel);
printf("Enter your cars average miles per gallon.");
scanf("%f",&mpg);
printf("Enter Total number of miles for the trip.");
scanf("%f",&miles);
printf("Trip Summary")
printf("Fuel Required %.2f", miles / mpg);
printf("Enter Total amount of fuel required")
scanf("%f",&fuelr);
printf(fuelr * fuel);
}
Return 0;