//Date: 21 October 2012
//Write a function called OddCheck that takes one integer as an argument.
//The function should return a 1 if the number is odd and a 0 if it is even.
int OddCheck ( int iNum )
int iCheck = iNum % 2;
if (iCheck == 0)
iCheck = 0;
elseif (iCheck != 0)
iCheck = 1;
int main (void)
int iNum = 0;
cout << "Enter a number to check." << endl;
cin >> iNum;
cout << OddCheck (iNum) << endl;
Is there a better way? More concise, easier to read, anything?