0
Why should one use return =1 instead of 0?
the first lesson explained that any number more than 0 in return gives an error. So how come when learning factorials the example the return is given as 1 and not 0.
2 Respostas
0
Returning zero is only necessary for the main function, but every other function u create can return any number. If u were to return zero in the recursion function u would be multiplying by zero and ur output would then be zero
- 1
factorials