C++ Programming Tutorial

 
 
 
 

Image

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

 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(n<=1)
       return n;

    else
       return (fibonacci(n-1)+fibonacci(n-2));
 }

    Related Post:
  1. Program of LL Parser

  2. Program to estimate the Integral value of the function at the given points from the given data using Simpsons 1/3 Rule

  3. Program to estimate the value of Second Derivative of the function at the given points from the given data using Central Difference Formula of order 2

  4. Program to show the implementation of Liang-Barsky Line Clipping Algorithm

  5. Program for Fahrenheit to Celcius using Class

  6. Program to draw a 3D Bezier Surface for MxN control points

  7. Program that reads a numbers , computes and displays the factorial of the given number using recursion

  8. Program to show the 3D Reflection Transformation along xy-plane

  9. PROGRAM FOR ACCEPTING MEASUREMENTS IN METERS AND FEETS AND SUMMING THEM UP IN THE FORMAT THAT THE USER WISHES

  10. Program to perform insertion sort

  11. Program to read a Linear System of Equations,then evaluate it by using Guass-Seidel Itrative Method and show the result

  12. Program to show the implementation of None-or-All String Clipping Strategy (Text Clipping Example)

  13. Program that takes short date from a user and displays medium date

  14. Program to implement the Prims Algorithm to solve Minimum Spanning Tree Problem (MST) using Graphics and with Mouse support

  15. Program for Fahrenheit to Celcius

  16. Program that takes short date from a user and displays long date

  17. Program to add, subtract, multiply, sort, search, transpose and merge matrices

  18. Program to illustrate passing structures to function

  19. Program to read 2D array and display it row by row and its sum

  20. Program to implement Add and Subtract functions on Big Number Class