title: Program To Find Remainder Without Using Modulo Or Operator 2
signature: function programToFindRemainderWithoutUsingModuloOrOperator2($num, $divisor) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($num, $divisor, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($num, $divisor), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        70, 13, 
        5));
      
      printf("TEST-1...%s\n",driver(
        77, 3, 
        2));
      
      printf("TEST-2...%s\n",driver(
        77, 73, 
        4));
      
      printf("TEST-3...%s\n",driver(
        88, 54, 
        34));
      
      printf("TEST-4...%s\n",driver(
        96, 39, 
        18));
      
      printf("TEST-5...%s\n",driver(
        6, 10, 
        6));
      
      printf("TEST-6...%s\n",driver(
        79, 95, 
        79));
      
      printf("TEST-7...%s\n",driver(
        44, 32, 
        12));
      
      printf("TEST-8...%s\n",driver(
        26, 86, 
        26));
      
      printf("TEST-9...%s\n",driver(
        82, 91, 
        82));
      
  }
  
  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;
  }