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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started