Write a function, initialVar, to initialize the variables such as zeroNum, oddNum and evenNum using the paramete reference technique.
Write another function getNum to get the integer number.
Write a third funciton determineNum to detemine whether the number is odd, even or zero. This function also increments the appropriate count.
Write a fourth function printResult to print the results
Lastly write the main function to call these
a. call the functionb initialVar
int initialVar();
int getNum();
void determineNum(int num, int &evenNum, int &oddNum, int &zeroNum);
void printResult(int evenNum, int oddNum, int zeroNum);
int initialVar ()
{ int evenNum = 0;
int oddNum = 0;
int zeroNum = 0;
}
int getNum()
{
int n;
std::cout << "\n\nInsert the interger number: ";
std::cin >> n;
return n;
}
void determineNum(int num, int &evenNum, int &oddNum, int &zeroNum)
{
if(num!=0)
{
if((num%2) ==0)
evenNum++;
else
oddNum++;
}
else
{
zeroNum++;
}
}
void printResult(int evenNum, int oddNum, int zeroNum)
{
std::cout << "Number of even: " << evenNum << std::endl;
std::cout << "Number of odd: " << oddNum << std::endl;