39.5k views
0 votes
c Assign to maxSum the max of (numA, numB) PLUS the max of (numY, numZ). Use just one statement. Hint: Call FindMax() twice in an expression.

User Clarkitect
by
6.9k points

1 Answer

2 votes

Answer:

maxSum = FindMax(numA, numB) + FindMax(numY, numZ);

Step-by-step explanation:

In the statement, maxSum is a double type variable which is assigned the maximum of the two variables numA numB PLUS the maximum of the two variables numY numZ using which are found by calling the FindMax function. The FindMax() method is called twice in this statement one time to find the maximum of numA and numB and one time to find the maximum of numY numZ. When the FindMax() method is called by passing numA and numB as parameters to this method, then method finds if the value of numA is greater than that of numB or vice versa. When the FindMax() method is called by passing numY and numZ as parameters to this method, then method finds if the value of numY is greater than that of numZ or vice versa. The PLUS + sign between the two method calls means that the resultant values returned by the FindMax() for both the calls are added and the result of addition is assigned to maxSum. The screenshot of program along with its output is attached.

c Assign to maxSum the max of (numA, numB) PLUS the max of (numY, numZ). Use just-example-1
User Melique
by
6.9k points