Question: Exercise 6. C programming 4. Repeat Exercise 3, but this time using a type named Complex. 5. Write the following functions, assuming that the date

Exercise 6. C programming
 Exercise 6. C programming 4. Repeat Exercise 3, but this time

4. Repeat Exercise 3, but this time using a type named Complex. 5. Write the following functions, assuming that the date structure contains three m members month, day, and year (all of type int). (a) int day_of_ year (struct date d); Returns the day of the year (an integer between 1 and (b) int compare_dates (struct date d1, struct date d2); Returns-1 if d1 is an earlier date than d2, +1 if d1 is a later date than d2, and 0 if dl and 366) that corresponds to the date d d2 are the same. Write the following function, assuming that the time structure contains three members: hours, minutes, and seconds (all of type int). struct time split_time (long total_seconds); total_seconds is a time represented as the number of seconds since midnight. The function returns a structure containing the equivalent time in hours (0-23), minutes (0-59, and seconds (0-59). 6. 7. Assume that the fraction structure contains two members: numerator and nator (both of type int). Write functions that perform the following operations orn tions: frac- (a) Reduce the fraction f to lowest terms. Hint: To reduce a fraction to lowest terms The first compute the greatest common divisor (GCD) of the numerator and denominato divide both the numerator and denominator by the GCD. (b) Add the fractions f1 and f2. (c) Subtract the fraction f2 from the fraction f1. (d) Multiply the fractions fl and 2

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!