Chemistry, asked by lokiprivate, 1 year ago

If the value of x is 5 and y is 2, what will be the return value of the function given below.
fun(x,y)
{

if(x == 0){
return y;
}
else{
return fun(x-1, x+y);
}
}

Answers

Answered by ramshergill1986
0

Answer:

  1. bdjdbkssjsbesbsbdndbdndbbdd
  2. bbdjdbdidbdbdpabsjskdsjdb
  3. bjzjdndjdbcjccbxnbfjfjffbf
  4. bdnddndbdbfjdb.
  5. bdbdndbdod
  6. nndndndjdbd
Answered by tisonantonio99
5

Answer:17

Explanation: when x=5 and y=2  fun(5,2)  goes in and if condition becomes flase goes to else return (4,7)

goes on until x becomes 0 y gets added up 7+4+3+2+1=17

Similar questions