Comparing leading zeros in binary representations of two numbers | C # program to find the number with more leading zeroes . ; Function to compare the no . of leading zeros ; if both have same no . of leading zeros ; if y has more leading zeros ; Driver Code
using System ; class GFG { static void LeadingZeros ( int x , int y ) { if ( ( x ^ y ) <= ( x & y ) ) Console . WriteLine ( " STRNEWLINE Equal " ) ; else if ( ( x & ( ~ y ) ) > y ) Console . WriteLine ( y ) ; else Console . WriteLine ( x ) ; } static public void Main ( ) { int x = 10 , y = 16 ; LeadingZeros ( x , y ) ; } }