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:

  1. Write the function header (5 points)
  2. Write a sample function call. Before the function call, declare all variables used in the call. Initialize them if necessary. (5 pts)
  3. 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)
  4. Write the code of the function (10 pts)
  5. 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

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!