As an example in pseudocode:

if ((a mod 2) == 0){ isEven = true;}else{ isEven = false;}

if ((a mod 2) == 0)

{

isEven = true;

}

else

isEven = false;

For non-negative integers, you can try the remainder operator %. For your exact instance:

if ((a % 2) == 0){ isEven = true;}else{ isEven = false;}

if ((a % 2) == 0)

This can be modifed to a one-liner:

isEven = (a % 2) == 0;