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