Consider the following function mys.
def mys ( ):
If m == 1:
return (1)
else :
return (m*mys(m - 1) )
Which of the following is correct ?
1. The function always terminates with
mys(n) = factorial of n
2. The function always terminates with
mys (n) = 1+2+...+n
3. The function terminates for non negative n with mys (n) = factorial of n
4. The function for positive n with mys(n)= factorial of n
4. The function for positive n with mys(n)= factorial of n
Comments
Leave a comment