how to check if the last number in an integer is a even or odd number in c++ code example
Example: number is even or odd c++
if ( n % 2 == 0)
cout << n << " is even.";
else
cout << n << " is odd.";
if ( n % 2 == 0)
cout << n << " is even.";
else
cout << n << " is odd.";