C++ Programming Tutorial

 
 
 
 

Image

 # include <iostream.h>
 # include    <conio.h>

 long Table[25]={0};

 const long fibonacci(const int);

 int main()
 {
    clrscr( );

    int number;

    cout<<\"\\n Enter the number ( 1 - 25 ) = \";
    cin>>number;

    number=((number>25)?25:number);

    cout<<\"\\n\\n The \"<<number<<\"_th term of fibonacci series = \"<<fibonacci(number);

    getch( );
    return 0;
 }


 //----------------------------  fibonacci( )  ---------------------------//


 const long fibonacci(const int n)
 {
    if(Table[n]==0)
    {
       if(n<=1)
      Table[n]=n;

       else
      Table[n]=(fibonacci(n-1)+fibonacci(n-2));
    }

    return Table[n];
 }

    Related Post:
  1. Program for Fahrenheit to Celcius

  2. Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student

  3. To parse a string using Operator Precedence parsing

  4. Program that list of letters should be an alphabetical list of upper case letters followed by an alphabetical list of lower case letters

  5. Program to perform quick sort

  6. Program to computes the n_th term of the fibonacci series using Dynamic Programming Technique

  7. Program that places n equally spaced points on the circumference of a circle of radius r,and then join each point to every other point

  8. Program to find largest integer among the three and display it using function with no return type

  9. Program to read a Non-Linear equation in one variable, then evaluate it using False-Position Method and display its kD accurate root

  10. Program that provides an example of binary files

  11. Program to show the implementation of Sutherland-Hodgeman Polygon Clipping Algorithm

  12. Program to illustrate the implementation of Stack as an Arithmetic Expression Evaluater

  13. Program of simple Constructions

  14. Program to add pairs of MxN matrices

  15. Program to draw a line using Bresenhams Line Algorithm (BLA) for lines with slopes positive and less than 1

  16. Program to illustrate the implementation of arrays as a Circular Queue ( in graphics )

  17. Program to draw a circle using Bresenhams Circle Algorithm

  18. Program that will read a token from a user and find its type

  19. Projects of Employee Record Keeping System using nested structure

  20. Program for converting int to class object