1. Engineering
  2. Computer Science
  3. this is an example of a function where you do...

Question: this is an example of a function where you do...

Question details

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]

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution