C Programming MCQ

1: Following is a recursive function for computing the sum of integers from 0 to N. function sum(N:integer):integer begin if N=0 then Sum=0 else end; The missing line in the else part is
A. Sum:=N+Sum(N)
B. Sum:=N+Sum(N-1)
C. Sum:=(N-1)+Sum(N+1)
D. Sum:=(N-1)+Sum(N-1)
 

Answer : B

Explanation :

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.