Check if an Octal number is Even or Odd | Check if the number is odd or even ; Check if the last digit is either '0' , '2' , '4' , or '6' ; Driver code
function even_or_odd ( N ) { var len = N . length ; if ( N [ len - 1 ] == ' ' N [ len - 1 ] == ' ' N [ len - 1 ] == ' ' N [ len - 1 ] == ' ' ) return ( " " ) ; else return ( " " ) ; } var N = " " ; document . write ( even_or_odd ( N ) ) ;