There is a function in the scope that divides 10 by the passed number.
def divide10(n: Int): Int = 10 / n
Complete the code of the protectedDivide function so that zero is returned in case of a division error.
There is a function in the scope that divides 10 by the passed number.
def divide10(n: Int): Int = 10 / n
Complete the code of the protectedDivide function so that zero is returned in case of a division error.
Sample Input 1:
1
0Sample Output 1:
10
0Create a free account to access the full topic