text: Check if a number is divisible by 8 using bitwise operators | function to check number is div by 8 or not using bitwise operator ; Driver code
code: function Div_by_8 ( n ) { return ( ( ( n >> 3 ) << 3 ) == n ) ; } var n = 16 ; if ( Div_by_8 ( n ) ) document . write ( " " ) ; else document . write ( " " ) ;