int func2(int m, int n) { if( n ==0 ) return0; else return m +func2(m, n-1); } a
ID: 3615747 • Letter: I
Question
int func2(int m, int n) {if( n ==0 )
return0;
else
return m +func2(m, n-1);
}
a) What is the limiting condition of the code above?
a. n >= 0 b. m > n
c. m >= 0 d. n >m
b) What is the output of func2(2,3)?
a. 2 b. 3
c. 5 d. 6
c) Which of the following statements about the code above is alwaystrue?
a. func2(m,n) = func2(n,m) for m > = 0
b. func2(m,n) = m * n for n >= 0
c. func2(m,n) = m + n for n >= 0
d. func2(m,n) = n * m for n >= 0
*feel free to answer in multiple posts