title: Program To Find Remainder Without Using Modulo Or Operator 2
signature: function programToFindRemainderWithoutUsingModuloOrOperator2(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(70, 13, 5);
    console.log(`TEST-0...${result}`);
  
    result = driver(77, 3, 2);
    console.log(`TEST-1...${result}`);
  
    result = driver(77, 73, 4);
    console.log(`TEST-2...${result}`);
  
    result = driver(88, 54, 34);
    console.log(`TEST-3...${result}`);
  
    result = driver(96, 39, 18);
    console.log(`TEST-4...${result}`);
  
    result = driver(6, 10, 6);
    console.log(`TEST-5...${result}`);
  
    result = driver(79, 95, 79);
    console.log(`TEST-6...${result}`);
  
    result = driver(44, 32, 12);
    console.log(`TEST-7...${result}`);
  
    result = driver(26, 86, 26);
    console.log(`TEST-8...${result}`);
  
    result = driver(82, 91, 82);
    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_2(num, divisor):
      while (num >= divisor):
          num -= divisor
      return num
source_cpp: int program_to_find_remainder_without_using_modulo_or_operator_2(int num, int divisor) {
    while ( num >= divisor ) num -= divisor;
    return num;
  }