Greatest divisor which divides all natural number in range [ L , R ] | Function to return the greatest divisor that divides all the natural numbers in the range [ l , r ] ; Driver Code
< ? php function find_greatest_divisor ( $ l , $ r ) { if ( $ l == $ r ) return $ l ; return 1 ; } $ l = 2 ; $ r = 12 ; echo find_greatest_divisor ( $ l , $ r ) ; ? >