Write a c function named liquid that is to accept an


Write a C function named liquid() that is to accept an integer number and the addresses of the variables gallons, quarts, pints, and cups. The passed integer represents the total number of cups, and the function is to determine the number of gallons, quarts, pints, and cups in the passed value. Using the passed addresses, the function should directly alter the respective variables in the calling function. Use the relationships of 2 cups to a pint, 4 cups to a quart, and 16 cups to a gallon.

Include this function in a program, printing the results after the function has run.

If the user enters 27 cups, the output should be:
1 gallon
2 quarts
1 pint
1 cup

and not:

1 gallon
6 quarts
13 pints
27 cups

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a c function named liquid that is to accept an
Reference No:- TGS01248398

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)