im trying to make a counter to count the number of odd numbers in an integer entered by a user but somehow my loop doesnt seem to go on as i hoped it would...im trying practise using the while loop that some of u guys demonstrated on my other thread...
#include <iostream>
using namespace std;
int main()
{
int oddNum, num, oddCount = 0;
cout << "enter an integer: " << endl;
cin >> num;
while (oddNum != 0 && num > 10)
{
num = num % 10;
oddNum = num % 2;
oddCount++;
}
cout << "number of odds is " << oddCount << endl;
}