title: Program To Find Remainder Without Using Modulo Or Operator
signature: func programToFindRemainderWithoutUsingModuloOrOperator(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(80, 
  	54, 26)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(63, 
  	21, 0)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(1, 
  	56, 1)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(22, 
  	39, 22)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(66, 
  	7, 3)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(61, 
  	67, 61)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(45, 
  	63, 45)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(29, 
  	44, 29)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(95, 
  	65, 30)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(9, 
  	68, 9)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def program_to_find_remainder_without_using_modulo_or_operator(num, divisor):
      return (num - (divisor * (num // divisor)))
source_cpp: int program_to_find_remainder_without_using_modulo_or_operator(int num, int divisor) {
    return ( num - divisor * ( num / divisor ) );
  }