title: Program To Find Remainder Without Using Modulo Or Operator 1
signature: class Solution {
  
      public Integer programToFindRemainderWithoutUsingModuloOrOperator1(Integer num, Integer divisor) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer num, Integer divisor, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(num, divisor,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(34, 55, 34);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(63, 22, 19);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(15, 26, 15);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(56, 58, 56);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(63, 94, 63);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(28, 45, 28);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(54, 97, 54);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(2, 58, 2);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(94, 91, 3);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(82, 40, 2);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer num, Integer divisor, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(num, divisor),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
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 );
  }