Skip to content

Instantly share code, notes, and snippets.

@jakedobkin
Created November 10, 2011 19:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakedobkin/1355909 to your computer and use it in GitHub Desktop.
Save jakedobkin/1355909 to your computer and use it in GitHub Desktop.
Euler Problem 2a
<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