Count trailing zero bits using lookup table | Simple Java code for counting trailing zeros in binary representation of a number ; Driver Code
import java . io . * ; class GFG { public static int countTrailingZero ( int x ) { int count = 0 ; while ( ( x & 1 ) == 0 ) { x = x >> 1 ; count ++ ; } return count ; } public static void main ( String [ ] args ) { System . out . println ( countTrailingZero ( 11 ) ) ; } }