forked from ambujraj/hacktoberfest2018
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ambujraj#1023 from rahulchauhan049/master
Rahul-fibonacci
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |