#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int lowNum, highNum, fixer;
cout << "Enter two integer values.\n";
cin >> lowNum >> highNum;
fixer = highNum;
if (highNum<=lowNum) //this if statement makes it so the numbers can be entered in whatever order
{
highNum = lowNum;
lowNum = fixer;
}
int count = lowNum + 1;
int top = highNum - 1;
cout << "Display of all odd numbers between " << lowNum << " and " << highNum << ". ";
while (count <= top)
{
if (count % 2 != 0)
cout << count << " ";
count ++;
}
cout << "\n";
count = lowNum + 1;
int sum = 0;
while (count <= top)
{
if (count % 2 == 0)
sum = sum + count;
count++;
}
cout << "Sum of all even numbers between " << lowNum << " and " << highNum << "= " << sum;
cin.get();
cin.get();
}