You are viewing a single comment's thread. Return to all comments →
create febbo series first till 50 is enough
then just find input number in series if it is there then print IsFebo else IsNotFebo......find snap code for that
int t =Convert.ToInt32(Console.ReadLine()); // creating Febo series long[] N = new long[100000]; for(long i=0;i<80;i++) { if(i==0) { N[i] = 0; } else if (i == 1) { N[i] = 1; } else { N[i] = N[i - 1] + N[i - 2]; } } while(t>0) { long value = Convert.ToInt64(Console.ReadLine()); if(N.Contains(value)) { Console.WriteLine("IsFibo"); } else Console.WriteLine("IsNotFibo"); t--; }
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 →
create febbo series first till 50 is enough
then just find input number in series if it is there then print IsFebo else IsNotFebo......find snap code for that