-
2 Comments
Peter Wittenberg
on 14 Apr 2012
OK, I gamed this one so it only works up to about 1 billion. I wanted to see everyone else's interesting solutions.
Revathe Thillaikumar
on 8 May 2022
You can first generate the even fibonacci numbers for the given first two elements (here, 1 and 2) till they reach x, then sum the calculated even numbers (that are less than or equal to the input value x).
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!