Skip to content

Commit

Permalink
Merge pull request ambujraj#1023 from rahulchauhan049/master
Browse files Browse the repository at this point in the history
Rahul-fibonacci
  • Loading branch information
ambujraj authored Oct 19, 2018
2 parents 9503b55 + c192641 commit b019fdc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ About: Student and Web developer! Likes AI.<br/>
Programming Language: c++, JS, HTML, CSS<br/>
Email: [email protected]<br/>

Name: [Rahul Chauhan](https://github.com/rahulchauhan049)
Place: Greater Noida, India
About: web developer, speaker, alexa skills, aog
Programming Language: Javascript?
Email: [email protected]


Name: [Warushika Hansini](https://github.com/warushika)<br/>
Place: SRILANKS<br/>
About: Student and Web developer! Likes AI and UI& UX.<br/>
Expand Down
27 changes: 27 additions & 0 deletions fibonacci/rahul-fibonacci.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//import libraries
#include <iostream>

using namespace std;
//call fibonacci function
int fibo(int);
//************************
int main()
{
cout<<"Enter a number: ";
int a;
cin>>a;
for(int i=0;i<a;i++){
cout<<fibo(i);
}
return 0;
}

//make fibonacci function
int fibo(int a){
if(a<2){
return a;
}
else{
return fibo(a-1)+fibo(a-2);
}
}

0 comments on commit b019fdc

Please sign in to comment.