123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

   Computer Science / IT
   Electronics
   Electrical
   Mechanical
   Chemical
   Civil

   CAT / MBA

   GMAT / Foreign MBA
Latest Jobs

Engineering Jobs / Technical Jobs
Management Jobs

Sitemap
Terms of use

Displaying  Source Code(s)  
 

 
FIBONACCI ALGORITHM

--------------------------------------------------------------------------------

Description : TRY OUT MY WEBSITE HTTP:// HARYIIPSONE.TRIPOD.COM

Code :

/*************************************************************************
*

**************************************************************************

A C++ Program to computes the n_th term of the fibonacci series using
Divide and Conquer Strategy.


**************************************************************************

*************************************************************************/


/*************************************************************************
/



// DOWNLOADED FROM -: HARYIIPSONE.TRIPOD.COM

// CODED-By : HARSHIT PANDEY

// E-mail : HARYIIPSONE.TRIPOD.COM

// Web-Site : HARYIIPSONE.TRIPOD.COM

// ******** THINK HIGH TO ACHIEVE HIGH **********




/*************************************************************************
*/


/*************************************************************************
/

/*************************************************************************
/
//--------------------------- Header
iles ----------------------------//

/*************************************************************************
/

/*************************************************************************
/

# 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 =<BR><<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));
}


/*************************************************************************
/

/*************************************************************************
/
//----------------------------- End of
ile ---------------------------//

/*************************************************************************
/

/*************************************************************************
/

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG