Answer:
The program in C++ is as follows:
#include <iostream>
using namespace std;
int main(){
int numbers[50];
int evekount = 0, odkount = 0;
for(int i = 0; i<50;i++){
cin>>numbers[i];
if(numbers[i]%2==0){ evekount++; }
else{ odkount++; }
}
cout<<"Even Count: "<<evekount<<endl;
cout<<"Odd Count: "<<odkount<<endl;
return 0;
}
Explanation:
This declares the integer array of number
int numbers[50];
This initializes the even count and odd count to 0
int evekount = 0, odkount = 0;
This iterates from 1 to 50
for(int i = 0; i<50;i++){
This gets input for the array
cin>>numbers[i];
This checks for even
<em> if(numbers[i]%2==0){ evekount++; }</em>
This checks for odd
<em> else{ odkount++; }</em>
}
This prints the even count
cout<<"Even Count: "<<evekount<<endl;
This prints the odd count
cout<<"Odd Count: "<<odkount<<endl;