Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, Please complete only problems 2 and 5 and show output for both. Thank you 2. Write a C function named liquid() that is to

Hello, Please complete only problems 2 and 5 and show output for both. Thank you

image text in transcribed

2. Write a C function named liquid() that is to accept an integer numbe r and the addresses of the variables gallons, quarts, pints, and cups. The passed resents the total number of cups, and the function is to determine the number of lons, quarts, pints, and cups in the passed valuc. Using the passed addresses, the should directly alter the respective variables in the calling function. Use the rel of 2 cups to a pint, 4 cups to a quart, and 16 cups to a gallon. 3. Rewrite the findMax () function in Program 6.2 so that the variable max is decl ared main() and the maximum value of the two passed numbers is written directlyto max Hint: The address of max will also have to be passed to findMax ().) . Modify Program 7.10 to accept a character parameter named sortorder. If sort is an a, swap () should exchange values only if the first value is larger than the seco value; that is, the function should return the values in ascending order (smallest nun first, largest number second). For any other value, the function should return the val in descending order (largest number first, smallest number second). Write a C function named yrCalc) that accepts a longer integer representing the total number of days from the date 1/1/1900 and the addresses of the variables year month, and day. The function is to calculate the current year, month, and day for given number of days and write these values directly in the respective variables using t assed addresses. For this problem assume that cach year has 365 days and each monih has 30 days

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions