Initial commit

This commit is contained in:
Michael Reber
2019-11-15 12:59:38 +01:00
parent 40a414d210
commit b880c3ccde
6814 changed files with 379441 additions and 0 deletions
@@ -0,0 +1,67 @@
A C++ Program to computes the n_th term of the fibonacci series using
Divide and Conquer Strategy.
Code :
# include <iostream.h>
# include <conio.h>
//------------------------ Function
rototypes ------------------------//
const long fibonacci(const int);
//-----------------------------
main( ) -------------------------------//
int main()
{
clrscr( );
int number;
cout<<"
Enter the number ( 1 - 25 ) = ";
cin>>number;
number=((number>25)?25:number);
cout<<"
The "<<number<<"_th term of fibonacci series =
"<<fibonacci(number);
getch( );
return 0;
}
//------------------------ Function
efinitions -----------------------//
//----------------------------
fibonacci( ) ---------------------------//
/
const long fibonacci(const int n)
{
if(n<=1)
return n;
else
return (fibonacci(n-1)+fibonacci(n-2));
}