Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module EvenFibonacci 'My solution to Project Euler Problem 2
- Sub Main()
- Dim S = 0, R = 0, N1 = 0, N2 = 1
- While S <= 4000000
- S = N1 + N2
- If S Mod 2 = 0 Then R += S
- N1 = S
- S += N2
- If S Mod 2 = 0 Then R += S
- N2 = S
- End While
- Console.WriteLine(R)
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement