adding recursion review question

This commit is contained in:
Jidong Xiao
2024-02-02 13:45:58 -05:00
parent 850a381bff
commit 79e83be573

View File

@@ -14,8 +14,11 @@ What is the value of fun(2)?
```cpp
int fun(int n) {
if (n == 4) return n;
else return 2*fun(n+1);
if (n == 4){
return n;
} else {
return 2 * fun(n+1);
}
}
```