Respuesta :

A program with a car's gas mileage (miles/gallon) and the cost of gas (dollars/gallon) as floating-point input, and output the gas cost for 20 miles, 75 miles, and 500 miles is given below:

#include <stdio.h>

int main(void) {

  double milesperGallon;

  double costperGallon;

  double totalCost;

  double totalCost2;

  double totalCost3;

 

  scanf("%lf", &milesperGallon);

  scanf("%lf", &costperGallon);

 

  totalCost = (20 / milesperGallon) * costperGallon;

  totalCost2 = (75 / milesperGallon) * costperGallon;

  totalCost3 = (500 / milesperGallon) * costperGallon;

 

  printf("%0.2lf", totalCost);

  printf(" %0.2lf", totalCost2);

  printf(" %0.2lf\n", totalCost3);/* Type your code here. */

  return 0;

}

Read more about programming here:

https://brainly.com/question/23275071

#SPJ1