Write a statement that invokes the calc sum and diff


Write the C++ code for a void function that receives four int variables: the first two by value and the last two by reference. Name the formal parameters n1, n2, sum, and diff. The function should calculate the sum of the two variables passed by value and then store the result in the first variable passed by reference. It also should calculate the difference between the two variables passed by value and then store the result in the second variable passed by reference. When calculating the difference, subtract the contents of the n2 variable from the contents of the n1 variable. Name the function calc Sum And Diff. Also write an appropriate function prototype for the calc Sum And Diff function. In addition, write a statement that invokes the calc Sum And Diff function, passing it the num1, num2, num Sum, and num Diff variables.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Write a statement that invokes the calc sum and diff
Reference No:- TGS01594532

Expected delivery within 24 Hours