Check whether the binary equivalent of a number ends with "001" or not | Function to check if binary equivalent of a number ends in "001" or not ; To check if binary equivalent of a number ends in "001" or not ; Driver code
function CheckBinaryEquivalent ( N ) { return ( N - 1 ) % 8 == 0 ; } var N = 9 ; if ( CheckBinaryEquivalent ( N ) ) document . write ( " " ) ; else document . write ( " " ) ;