/*

Title: Fibonacci Series

Author: LF Cervantes

Date: Dec. 3, 2005

*/

#include <iostream>

#include <cmath>

using namespace std;

int main()

{

cout << "-- FIBONACCI SERIES --\n";

cout << "A program to compute the Nth value the \n"

<< "Fibonacci series.\n\n";

cout << "Enter N: ";

int N, FN;

cin >> N;

FN = static_cast<int>(1/sqrt(5)*( pow((1+sqrt(5))/2,N) - pow((1-sqrt(5))/2,N) ));

cout << "The Nth number in the series when N=" << N

<< " is " << FN << endl;

system("PAUSE");

return 0;

}

Highlights

More demos of math functions

conversion of math expression to C++ statement