shit voidMan. I feel bad now man
. I feel like a jackass now.
But thanks dude a lot
here is the whole program for whoever is intrested.
//Ex 3.20
#include <iostream.h>
#include <iomanip.h>
const int N=20;
void initialize(int& zerocount, int& oddcount, int& eventcount);
void getnumber(int& num);
void classifynumber (int num, int& zerocount, int& oddcount, int& evencount);
void printresults(int zerocount, int oddcount, int evencount);
int main()
{
int counter;
int number;
int zeros;
int odds;
int evens;
initialize (zeros, odds, evens);
cout<<"please enter "<<N<<"integers"<<endl;
cout<<"The numbers you entered are "<<endl;
for (counter=1; counter<=N; counter++)
{
getnumber(number);
cout<<setw(3)<<number;
classifynumber(number, zeros, odds, evens);
}
cout<<endl;
printresults(zeros, odds, evens);
return 0;
}
void initialize(int& zerocount, int& oddcount, int& evencount)
{
zerocount=0;
oddcount=0;
evencount=0;
}
void getnumber(int& num)
{
cin>>num;
}
void classifynumber(int num, int& zerocount, int& oddcount, int& evencount)
{
switch(num%2)
{
case 0:
evencount++;
if (num==0)
zerocount++;
break;
case 1:
case -1: oddcount++;
}
}
void printresults(int zerocount, int oddcount, int evencount)
{
cout<<"There are "<<evencount<< " evens, "<<"which also includes "<< zerocount<<" zeros"<<endl;
cout<<"Total number of odds are: "<<oddcount<<endl;
}