Program to find remainder without using modulo or % operator | C ++ program to find remainder without using modulo operator ; This function returns remainder of num / divisor without using % ( modulo ) operator ; Driver program to test above functions
#include <iostream> NEW_LINE using namespace std ; int getRemainder ( int num , int divisor ) { return ( num - divisor * ( num / divisor ) ) ; } int main ( ) { cout << getRemainder ( 100 , 7 ) ; return 0 ; }