Question: For c++ Write a function addOddMinusEven that takes two integers indicating the starting point and the end point. Then calculate the sum of all the
For c++ Write a function addOddMinusEven that takes two integers indicating the starting point and the end point. Then calculate the sum of all the odd integers minus the sum of all even integers between the two points. The calculation includes the starting point but excludes the end point. You can always assume the starting point is smaller than the end point.
-
Your function should be named addOddMinusEven
-
Your function should take two integers.
-
Your function should return an integer as described above.
-
Your function should not print/output anything
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
