How many function calls will be performed to execute the following recursive function? void function(int N){ if(N==0) return; function(N+1); }

How many function calls will be performed to execute the following recursive function?

void function(int N){
    if(N==0)
    return;
    function(N+1);
}
  1. a) N
  2. b) 2*N
  3. c) Infinite
  4. d) The answer can vary depending on the initial value of N

From the Combined Bank Assistant Programmer (CSE) 2020 – Preliminary (DU) exam, question 35 of 47.

More from this paper