Question: As you know a user-defined function can be: 1. a value returning function 2. a void function 3. passing an argument by value 4. passing
As you know a user-defined function can be: 1. a value returning function 2. a void function 3. passing an argument by value 4. passing an argument by reference Let's create a simple calculator using user-defined functions that implement the above four scenarios. Function #1 - adding two numbers (integers) Please create a value-returning, pass-by-value function for it. Function #2 - subtracting two numbers (integers) Please create a void pass-by-reference function to fulfill the task. Function #3 - multiplying two numbers (integers) Please design and implement this function your way, and, explain why you design your function this way. (You may write your reasons as comments to this function in your program.) In your main() function, you must create driver code to test each of the three functions you created
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
