Unnamed
public text v1 · immutable#include <iostream.h>
#include <conio.h>
int main()
{
int iNum = 0 , //Number being inputted
iRem = 0 ; //Remainder after (iNum%2)
cout <<"Input your number " ;
cin >>iNum ;
iRem = iNum%2 ; //does the calculation
cout<<iRem <<endl; //this is just to show the number to error check
if (iRem=1) //so it can say it's odd
{
cout << "The number is odd." ;
}
else if (iRem=0) //so it can say it's even
{
cout << "The number is even." ;
}
getch() ;
}