C Program - Write main and two other functions named ComputeMaximum and ComputeMinimum that return the larger and smaller, respectively, of two type double arguments:

1. Each function must be in a separate file.

2. The files containing ComputeMaximum and ComputeMinimum may not contain #defines, #includes, if statements, switch statements, looping statements, or variables that are not formal parameters.

3. All printing must be done in main.

4. The file containing main may only #include standard library header files, and only if needed.

E. Test each Compute… function with the following value pairs: 1 20 20 1 -4 3 3 -4

Recommended Answers

All 2 Replies

This is another of those "your assignment is to eat, but you can't touch the food with anything", kind of an exercise. ;)

Which means the lecturer will have given you hints (maybe subtle, maybe not), about how he/she wants you to proceed with this.

Review your class notes, and remember what those clues were, for a first step.

Second step, is to post up your try at this problem. Be specific about what the problem is that has you, or your program, stumped. "Won't work", on a post from you, won't work with us.

I think your problem is with having the functions in different files...right ???
So, post your code for the main function and the two max-min functions and we will help in the multiple file issue as the next step, only when you post your effort.

So, go for it...Best of luck !!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.