title: Program To Find Remainder Without Using Modulo Or Operator 2
signature: func programToFindRemainderWithoutUsingModuloOrOperator2(num int, divisor int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(num int, divisor int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(num, divisor),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(70, 
  	13, 5)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(77, 
  	3, 2)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(77, 
  	73, 4)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(88, 
  	54, 34)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(96, 
  	39, 18)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(6, 
  	10, 6)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(79, 
  	95, 79)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(44, 
  	32, 12)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(26, 
  	86, 26)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(82, 
  	91, 82)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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;
  }