check if a number is even in C code example
Example 1: how to check if number is even
if ( n % 2 == 0 ) {
// n is even
}
else {
//otherwise odd
}
Example 2: how to know if a number is even in c
if((x & 1) == 0)
printf("EVEN!\n");
else
printf("ODD!\n");