Check out example codes for "number is even or odd c++". It will help you in understanding the concepts better.

Code Example 1

if ( n % 2 == 0)
        cout << n << " is even.";
    else
        cout << n << " is odd.";

Learn ReactJs, React Native from akashmittal.com