Menu

[solved] – Question 79939

Consider the following function f.

def f(m):
if m==0:
return(0)
else:
return(m+f(m-1))

Which one of the following is correct?
1)The function always terminates with f(n)=n(n+1)/2
2)The function always terminates with f(n)=factorial of n
3)The function terminates for non-negative n with f(n)=n(n+1)/2
4)The function terminates for non-negative n with f(n)=factorial of n

Expert Answer


OR


Leave a Reply

Your email address will not be published. Required fields are marked *