// Given an arbitrary set of positive integer numbers // finds how many are odd numbers and how many are even numbers #include using std::cout; using std::cin; using std::endl; // function main int main() { int sumeven = 0; int sumodd = 0; int numtot = 0; int number; cout << " Enter a positive integer number, -1 to exit "; cin >> number; while (number != -1) { if ((number % 2) == 0) sumeven++; else sumodd++; numtot++; cout << " Enter a positive integer number, -1 to exit "; cin >> number; } //end while cout << " In a set of " << numtot << " positive integers " << endl << " there are " << sumeven << " even integers and " << sumodd << " odd integers " << endl; return 0; // successful termination } // end main