Question: This is an example of a function where you do not pass any parameters to the function and nothing is returned to the calling function.

This is an example of a function where you do not pass any parameters to the function and nothing is returned to the calling function. (the function returns void)

Write a C function that will :

1. in the function, ask the user for a number of gallons

  1. convert a given number of gallons into quarts, liters, cups, and fluid ounce.
  2. print out the answer in the function
  3. the output should look like:

??? gallons is:

??? quarts

??? liters

??? cups

??? fluid ounces

function header should be void convertGallons()

in main

  1. call your function
  2. the output should look like:

??? gallons is:

??? quarts

??? liters

??? cups

??? fluid ounces

Use the output (cout) manipulators to format the output correctly [setw(?), fixed, right, left, etc]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!