Created
November 10, 2011 19:35
-
-
Save jakedobkin/1355909 to your computer and use it in GitHub Desktop.
Euler Problem 2a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<script type="text/javascript"> | |
a = 1; | |
b = 1; | |
c = 0; | |
d = 0; | |
for (i=0;i<=30;i++) | |
{ | |
c = a + b; | |
if (c%2 == 0){ | |
d+=c; | |
} | |
a = b; | |
b = c; | |
} | |
document.write("the answer is " + d); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment