THANKS FOR HELPING ME, I APPRECIATE IT VERY MUCH!
This is what I have so far, but still confused on calculating all three for the overall average. I can't figure out for the life of me on how to get that to work. I will keep trying though!
Code:
#include <stdio.h>
int main(void)
{
/*Variable Delclarations*/
/*----------------------*/
int quotient, gallused, milesdriven;
float gallons_used;
float miles_driven;
float avg;
/*Display program info*/
/*--------------------*/
printf ("\nWelcome to My mileage calculator.\n");
printf ("\nThis program will calculate the miles per gallon for you for\n");
printf ("three tanks of gas after you have entered the gallons used and\n");
printf ("miles driven.\n");
/*Prompt user for information*/
/*------------------*/
printf ("\nEnter the number of gallons used for tank #1: ");
scanf ("%f", &gallons_used);
printf ("Enter the number of miles driven: ");
scanf ("%f", &miles_driven);
gallons_used = miles_driven / gallons_used;
printf ("***The miles per gallon used for this tank is %.1f \n",gallons_used);
printf ("\nEnter the number of gallons used for tank #2: ");
scanf ("%f", &gallons_used);
printf ("Enter the number of miles driven: ");
scanf ("%f", &miles_driven);
gallons_used = miles_driven / gallons_used;
printf ("***The miles per gallon used for this tank is %.1f \n",gallons_used);
printf ("\nEnter the number of gallons used for tank #3: ");
scanf ("%f", &gallons_used);
printf ("Enter the number of miles driven: ");
scanf ("%f", &miles_driven);
gallons_used = miles_driven / gallons_used;
printf ("***The miles per gallon used for this tank is %.1f \n",gallons_used);
gallons_used = gallons_used / avg;
printf ("\nYour overall average miles per gallon for three tanks is %.1f \n", avg);
/*Output final greeting*/
/*---------------*/
printf ("\nThanks for using My Mileage calculator program!\n");
} //end main