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
function findNum ( N , K ) { var rem = ( N + K ) % K ; if ( rem == 0 ) return N ; else return N + K - rem ; } var N = 45 , K = 6 ; document . write ( " " + N + " " + K + " " + findNum ( N , K ) ) ;