#include <iostream>
#include <cmath>
using namespace std;
double f(int n)
{
double x = (1 + pow(5, 0.5)) / 2;
return (pow(x, n) - pow((x - pow(5, 0.5)), n)) / pow(5, 0.5);
}
int main()
{
cout << "Enter the number... ";
int a;
cin >> a;
double z;
z = f(a);
cout << "n th Fibonacci num is= " << z;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpkb3VibGUgZihpbnQgbikKewogICAgZG91YmxlIHggPSAoMSArIHBvdyg1LCAwLjUpKSAvIDI7CiAgICByZXR1cm4gKHBvdyh4LCBuKSAtIHBvdygoeCAtIHBvdyg1LCAwLjUpKSwgbikpIC8gcG93KDUsIDAuNSk7Cn0KCmludCBtYWluKCkKewogICAgY291dCA8PCAiRW50ZXIgdGhlIG51bWJlci4uLiAiOwogICAgaW50IGE7CiAgICBjaW4gPj4gYTsKCiAgICBkb3VibGUgejsKICAgIHogPSBmKGEpOwoKICAgIGNvdXQgPDwgIm4gdGggRmlib25hY2NpIG51bSBpcz0gIiA8PCB6OwogICAgcmV0dXJuIDA7Cn0=