Program to find remainder without using modulo or % operator | Function to return num % divisor without using % ( modulo ) operator ; While divisor is smaller than n , keep subtracting it from num ; Driver code
function getRemainder ( num , divisor ) { while ( num >= divisor ) num -= divisor ; return num ; } let num = 100 , divisor = 7 ; document . write ( getRemainder ( num , divisor ) ) ;