Comparing leading zeros in binary representations of two numbers | Function to compare the no . of leading zeros ; if both have same no . of leading zeros ; if y has more leading zeros ; Driver Code
< ? php function LeadingZeros ( $ x , $ y ) { if ( ( $ x ^ $ y ) <= ( $ x & $ y ) ) echo " Equal " else if ( ( $ x & ( ~ $ y ) ) > $ y ) echo $ y ; else echo $ x ; } $ x = 10 ; $ y = 16 ; LeadingZeros ( $ x , $ y ) ; ? >