All pastes #2105115 Raw Edit

party code

public text v1 · immutable
#2105115 ·published 2012-01-22 19:00 UTC
rendered paste body
// Mileage and cost per trip calculator

#include <stdio.h>


int main(void)

{

    printf ("Enter a distance in kilometers:\n");
    double distance; 
    scanf("%lf,&distance");
    
    printf ("Enter the fuel efficiency of the vehicle in kilometers per litre of petrol:\n");
    double fuel;
    scanf("%lf,&fuel");
    
    printf ("Enter the cost of gasoline in cents per :\n");
    double gas;
    scanf ("%lf,&gas");
    
    printf ("The cost of the trip will be $%lf." ,(distance/100.0)*(fuel)*(gas));
    
    system("pause");
    
    return 0;
}