Skip to content

Instantly share code, notes, and snippets.

@kashwaa
Created January 30, 2014 21:42
Show Gist options
  • Save kashwaa/8720503 to your computer and use it in GitHub Desktop.
Save kashwaa/8720503 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main()
{
int x=0;
int y=1;
int ans=0;
while(y<4000000)
{
int temp=y+x;
x=y;
y=temp;
if(temp%2==0)
ans+=temp;
}
printf("%i\n",ans);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment