object RecursiveFunctionThatDividesTwoNumbers_Scala {
private def recursiveDivide(a: Int, b: Int): Int = {
if (a < b) {
0
} else {
recursiveDivide(a - b, b) + 1
}
}
def main(args: Array[String]): Unit = {
val a = 28
val b = 4
println(recursiveDivide(a, b))
}
}
/*
run:
7
*/