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 program
< ? php function Div_by_8 ( $ n ) { return ( ( ( $ n >> 3 ) << 3 ) == $ n ) ; } $ n = 16 ; if ( Div_by_8 ( $ n ) ) echo " YES " ; else echo " NO " ; ? >