Created
November 10, 2011 19:34
-
-
Save jakedobkin/1355903 to your computer and use it in GitHub Desktop.
Euler Problem 2
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; | |
document.write(c + "<br/>"); | |
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