title: Program To Find Remainder Without Using Modulo Or Operator 1
signature: function programToFindRemainderWithoutUsingModuloOrOperator1(num, divisor) {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value) {
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual, expected){
      return convertToString(actual)===convertToString(expected);
  }
  
  function driver(num, divisor, expected){
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(num, divisor),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(34, 55, 34);
    console.log(`TEST-0...${result}`);
  
    result = driver(63, 22, 19);
    console.log(`TEST-1...${result}`);
  
    result = driver(15, 26, 15);
    console.log(`TEST-2...${result}`);
  
    result = driver(56, 58, 56);
    console.log(`TEST-3...${result}`);
  
    result = driver(63, 94, 63);
    console.log(`TEST-4...${result}`);
  
    result = driver(28, 45, 28);
    console.log(`TEST-5...${result}`);
  
    result = driver(54, 97, 54);
    console.log(`TEST-6...${result}`);
  
    result = driver(2, 58, 2);
    console.log(`TEST-7...${result}`);
  
    result = driver(94, 91, 3);
    console.log(`TEST-8...${result}`);
  
    result = driver(82, 40, 2);
    console.log(`TEST-9...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    main();
  }
source_py: def program_to_find_remainder_without_using_modulo_or_operator_1(num, divisor):
      if (divisor == 0):
          return False
      if (divisor < 0):
          divisor = (- divisor)
      if (num < 0):
          num = (- num)
      i = 1
      product = 0
      while (product <= num):
          product = (divisor * i)
          i += 1
      return (num - (product - divisor))
source_cpp: int program_to_find_remainder_without_using_modulo_or_operator_1(int num, int divisor) {
    if ( divisor == 0 ) {
      return - 1;
    }
    if ( divisor < 0 ) divisor = - divisor;
    if ( num < 0 ) num = - num;
    int i = 1;
    int product = 0;
    while ( product <= num ) {
      product = divisor * i;
      i ++;
    }
    return num - ( product - divisor );
  }