Largest number smaller than or equal to N divisible by K | Function to find the largest number smaller than or equal to N that is divisible by k ; Driver code
< ? php function findNum ( $ N , $ K ) { $ rem = $ N % $ K ; if ( $ rem == 0 ) return $ N ; else return $ N - $ rem ; } $ N = 45 ; $ K = 6 ; echo " Largest ▁ number ▁ smaller ▁ than ▁ or ▁ equal ▁ to ▁ " , $ N , " that is divisible by " , ▁ $ K , ▁ " is " findNum ( $ N , $ K ) ; ? >