Question: Answer based on your understanding Function compute() will accept as parameters two numbers A and B. If A is greater than B, the function will
Answer based on your understanding
Function compute() will accept as parameters two numbers A and B. If A is greater than B, the function will multiply A and B, and put the product in A; otherwise, the function will put the sum of A and B in A.
Do the following:
- Write the function header (5 points)
- Write a sample function call. Before the function call, declare all variables used in the call. Initialize them if necessary. (5 pts)
- Assume that the function call is in the main() function, draw the execution stack. Draw a box for every variable and label it with a name, value and address( Arbitrary address A100, B100, C100, ...) (20 pts)
- Write the code of the function (10 pts)
- Copy the execution stack in #3 and simulate (10 pts)
Submission Requirement
Write your answers in a document file(doc, xls, ppt, etc.). If possible, convert the file into PDF. Use only C programming and only the stdio.h header.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
