Max occurring divisor in an interval | function to find max occurring divisor interval [ x , y ] ; if there is only one number in the in the interval , return that number ; otherwise , 2 is the max occurring divisor ; Driver program
function findDivisor ( x , y ) { if ( x == y ) return y ; return 2 ; } var x = 3 , y = 16 ; document . write ( findDivisor ( x , y ) ) ;