Question: Please write ONE program containing 5 functions. They should each match the function prototypes listed below. void printNumsBackwards ( int start, int end ) ;

Please write ONE program containing 5 functions. They should each match the function prototypes listed below.
void printNumsBackwards (int start, int end);
a. Takes two integers, with 'start' being larger than 'end', and prints all the numbers in between. Ex. printNumBackwards(10,3) should print "109876543"
b. Your program should throw an error message and let the user re-enter numbers until 'start' is larger than 'end'
float feet2meters (float f_length);
a. Takes a singe float representing a length in feet as a parameter, returns a float representing that same length in meters
float meters2feet (float m_length);
a. Takes a single float representing a length in meters, returns a float representing that same length in feet
b. For this function, I want you to use the returned value from feet2meters to verify that your math is being done correctly
int factorial (int n );
a. Takes a single integer 'n' and returns the factorial of that number. Ex. factorial(4) should return 24
float average (int a, int b, int c);
a. Takes 3 integers and returns the average of the three as a float. Ex. average(10,20,40) should return 23.33333...
Next write a main function which demonstrates that all 6 are working properly by calling each of them with user-supplied values (via scanf) and printing the results.
I would like the main to be structured where you scan in values for the function (except meters2feet), run the function, and print the output before moving onto the next function. You should ONLY be doing scanf inside of main(), not in the functions. The ONLY function that should contain a printf() is printNumBackwards.
Please write ONE program containing 5 functions.

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 Programming Questions!