title: Program To Find Remainder Without Using Modulo Or Operator 1
signature: programToFindRemainderWithoutUsingModuloOrOperator1(num, divisor) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(num, divisor, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(num, divisor), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          34, 55, 
          34)
      }");
  
      print("TEST-1...${driver(
          63, 22, 
          19)
      }");
  
      print("TEST-2...${driver(
          15, 26, 
          15)
      }");
  
      print("TEST-3...${driver(
          56, 58, 
          56)
      }");
  
      print("TEST-4...${driver(
          63, 94, 
          63)
      }");
  
      print("TEST-5...${driver(
          28, 45, 
          28)
      }");
  
      print("TEST-6...${driver(
          54, 97, 
          54)
      }");
  
      print("TEST-7...${driver(
          2, 58, 
          2)
      }");
  
      print("TEST-8...${driver(
          94, 91, 
          3)
      }");
  
      print("TEST-9...${driver(
          82, 40, 
          2)
      }");
  
      return 0;
  }
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 );
  }