Question: Write a void function that receives four int parameters: the first two by value and the last two byreference. Name the formal parameters n 1

Write a void function that receives four int parameters: the first two by value and the last two byreference. Name the formal parameters n1, n2, sum and diff. The function should calculate the sum ofthe two parameters passed by value and then store the result in the first variable passed by reference. Itshould calculate the difference between the two parameters passed by value and then store the result inthe second parameter passed by reference. When calculating the difference, subtract the larger value fromthe smaller value. Name the function calcSumAndDiff.

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!