Question: Create a program that sums all odd numbers between a and b (inclusive) using a for loop , where a and b are inputs. If

Create a program that sums all odd numbers between a and b (inclusive) using a for loop, where a and b are inputs. If a is greater than b, start from b instead.

Example Output:

With 2 given as input a and 6 given as input b

Please give a start number: 2 Please give an end start number: 6 The sum of all odd numbers between a and b (inclusive) is: 8

-- Please use C++ --

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!