You are viewing a single comment's thread. Return to all comments →
public static string isFibo(long n) { long first = 0; long second = 1; for(long i = 0; i < n; i++) { long temp = second; second += first; first = temp; if(second == n) return "IsFibo"; if(second > n) return "IsNotFibo"; } return "IsNotFibo"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Is Fibo
You are viewing a single comment's thread. Return to all comments →
C# Solution