You are viewing a single comment's thread. Return to all comments →
long long fiboEven(long long N) { if(N==1){ return 2; } else if(N==2){ return 8; } else { return 4*((fiboEven(N-1)))+fiboEven(N-2); } } long long addFibo(long long N){ long long sum=0,i; for(i=1;i<=N;i++){ if(fiboEven(i)<=N){ sum=sum + fiboEven(i); } else break; } return sum; }
Getting error in Test Case #3
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #2: Even Fibonacci numbers
You are viewing a single comment's thread. Return to all comments →
Getting error in Test Case #3