In C++ I am trying to display the odd numbers and average the even numbers between two integers.
The following is the code i have thus far...
This is what I have thus far..but cant figure out how to only display the odd numbers...havent begun averaging the even numbers....:
#include <iostream>
using namespace std;
void main (void)
{
int num1, num2, num = 0;
cout << "Please enter the the two numbers" <<endl;
cin>> num1 >> num2;
while (num1++ < num2)
cout <<num1;
if(num1 % 2 ==0)
cout << num1;