Question: c programming (1) Write a C program that generates 10 distances randomly. Each distance has two-piece of information: feet and inch. Your program must have

 c programming (1) Write a C program that generates 10 distances

c programming

(1) Write a C program that generates 10 distances randomly. Each distance has two-piece of information: feet and inch. Your program must have a function that gets the distances and calculates the sum and average of distances. Also, it should display the distances and the results in a tabular format shown below using feet and inch system. Also, write a second function that calculates the pairwise difference of distances in feet and inch system and prints the closest and furthest distances. Note: 12 inches = 1 feet output of second function output of first function distance feet inch 1 4' 6" 2 2 8" 3 5 11" Sum 13 1" Avg 4 4" difference of distance 1 and distance 2 is: 1 feet and 10 inches (22 inches) difference of distance 1 and distance 3 is : 1 feet and 5 inches (17 inches) difference of distance 2 and distance 3 is : 3 feet and 3 inches (39 inches) closest distance is: 1 feet and 5 inches furthest distance is: 3 feet and 3 inches

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!