nitind2411 / hacktoberfest-2022-DSA-CP

This Repository will contain Concepts of DSA and Competitive Programming in any language Mostly in C++
12 stars 33 forks source link

Create fibonacci.cpp #71

Closed DishaChaurasia closed 1 year ago

DishaChaurasia commented 1 year ago

include <bits/stdc++.h>

using namespace std; // program to find nth fibonacci number int fibonacci(int n) { if(n==0||n==1) return n; else return fibonacci(n-1)+fibonacci(n-2); }

int main() { int n; cin>>n; cout<<fibonacci(n); }

nitind2411 commented 1 year ago

Try to create PR on good and new DSA topics other than Fibonacci as it has been already added to repo @DishaChaurasia