Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Recursive code for Fibonacci Number
vaibhav1906
Nov 24th, 2021
1,115
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
C++
0.20 KB
| None
|
0
0
raw
download
clone
embed
print
report
class
Solution
{
public
:
int
fib
(
int
n
)
{
if
(
n
<=
1
)
return
n
;
return
fib
(
n
-
1
)
+
fib
(
n
-
2
)
;
}
}
;
/*
F(0)=0
F(1)=1
F(2)=1
F(3)=2
F(4)=3
F(5)=5
*/
Advertisement
Add Comment
Please,
Sign In
to add comment
Public Pastes
Untitled
19 min ago | 156.28 KB
This month smells like money
CSS | 20 min ago | 1.04 KB
⭐ Exploit Documentation ⭐
CSS | 20 min ago | 1.04 KB
✅ API Flaw Money Method
CSS | 20 min ago | 1.04 KB
Untitled
29 min ago | 503.05 KB
Untitled
51 min ago | 156.20 KB
compile_s7_format2
Python | 9 hours ago | 10.32 KB
compile_s7_format
Python | 10 hours ago | 0.94 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!