I'm running this infinite loop until a user enters zero and then I have to write the program so it will output how many even and odd integers the user inputted and then find the max and whether the umber of integers the user inputted is even or odd . could anyone please help me I'm new to programming!
<code>
#include <iostream>
using namespace std;
int main()
{
int x=1;
while(x>0)
{
cout << "Type integer( enter 0 to stop)"<< endl;
cin>> x;
}
return 0;
}
You need to accumulate statistics about the input. Store information in variables.
Perhaps counters for even and odd inputs. (Total input count can be calculated from those.)
Then a beholder of the largest value that has been inputted so far.