Skip to content

Instantly share code, notes, and snippets.

@KushalP
Created February 10, 2010 23:57
Show Gist options
  • Save KushalP/301014 to your computer and use it in GitHub Desktop.
Save KushalP/301014 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main()
{
unsigned int a = 1, b = 1, c = 2, sum = 0;
while (c < 4000000)
{
c = a + b;
sum += c * !(c % 2);
a = b;
b = c;
}
printf("%u\n", sum);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment