You are viewing a single comment's thread. Return to all comments →
En Java
public static long fibonacci(long limite) { long a = 1, b = 1; long suma = 0; while(true) { a = a+b; b = a-b; if(a>limite) break; if(a%2==0) suma+=a; } return suma; }
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 →
En Java