I know that is is a really simple thing, but some help would be appreciated. This is what I have thus far:

#include <iostream> #include <math.h> using namespace std; int main() { double gr = ceil((1 + sqrt(5))/2); int n; cout << "Enter number: "; cin >> n; cout << ceil((pow(gr, n) - pow(1 - gr, n))/sqrt(5))5 << " is the " << n << "th Fibonnaci number."; system("pause"); return 0; }

As far as I understand, this is how it is suppose to be, but it is not giving me the right answer.

The closed form of Fibonacci can be found here: http://en.wikipedia....form_expression

Thanks.