Question: This program is suppose to be written in C Write a small program that calculates the sum and the difference of two integers with three

This program is suppose to be written in C

This program is suppose to be written in C Write a small

Write a small program that calculates the sum and the difference of two integers with three user defined functions: /Itakes two integer arguments and returns the sum of the two arguments int CalculateSum (int numl, int num2) //takes two integer arguments and returns the difference of the two arguments int CalculateDiffernece int numl, int num2) /Itakes two integer arguments and two integer pointer arguments //1. calculate the sum and stores the result in sumptr /2. calculate the difference and store the result in diffPtr void CalculateBoth (int num1, int num2, int sumPtr, int diffPtr) Call all three functions from main. Print all the results inside the function definitions (value at) and ALSO print the results again back in the main function after the function has been called Main function logic (and hints) 1. Declare variables num!" num2, sum 1, diff1, sum2. dift2 2. Ask and get 2 numbers from the user (num1 and num2) 3. Pass num1 and num2 to the function CalculateSun and it will retum the sum to the variable Sum1 4. Print sum1 onto the screen 5. Pass num1 and num2 to the function CalculateDifference and it will return the difference to the variable diff 6. Print diff1 onto the screen 7. Pass num1 and num2 and "address of sum2 and "address of diff2 to the functilon CalculateBoth 8. Print sum2 and diff2 results onto the screen CalculateBoth function logic (and hints): Calculate the sum of num1 and num2 and store the result in the "value at" sumPtr Print the "value at" sumPtr ont the screen Calculate the difference of num1 and num2 and store the result in the "value at" diffPtr Print the "value at" diffPtr ont the screen //the function has a void return type

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!