Question: Q 3 Write the following function ( 5 marks ) : Name: SmallerSum Parameters: int x , int y , int z Job: Assume x

Q3 Write the following function (5 marks):
Name: SmallerSum
Parameters: int x, int y, int z
Job: Assume x is greater than y, and y is smaller than z. Output all the values from x to y, and their sum. Also output all the values from y to z, and their sum. The function will return whichever sum is smaller, either from x to y or from y to z.
The main() is provided. You only need to write the function. No need to write the full program or any #include statements.
int maino
1
cout "Enter x,y, and z;
cin xy2;
int S,x,y,z
wrter x,y and z=86
S=SmallerSum(x,y,z)
cout "Smaller Sum 6:456=15=15= endl endl;
return 0
Valves from eto42.87654
Values from 4to6:456 sum =15
Smaller Sur =15
Write the function here and continue to the other side of the page if required.
 Q3 Write the following function (5 marks): Name: SmallerSum Parameters: int

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!