Check out example codes for "how to check odd no. in c++ using logical and". It will help you in understanding the concepts better.

Code Example 1

#include <iostream>  
using namespace std;  
    
bool isEven(int n)  
{  
    return (!(n & 1));  
}  
   
int main()  
{  
    int n = 101;  
    isEven(n) ? cout << "Even" : cout << "Odd";  
    return 0;  
} 

Learn ReactJs, React Native from akashmittal.com