Skip to content

Instantly share code, notes, and snippets.

@jorgedfbranco
Created February 4, 2015 21:22
Show Gist options
  • Save jorgedfbranco/3c8c5fa7a35d815aa19e to your computer and use it in GitHub Desktop.
Save jorgedfbranco/3c8c5fa7a35d815aa19e to your computer and use it in GitHub Desktop.
#include <stdio.h>
// Problem 1
// https://projecteuler.net/problem=1
void main() {
int sum = 0;
int i;
for (i = 3; i < 1000; ++i)
if (i % 3 == 0 || i % 5 == 0)
sum += i;
printf("result = %d\n", sum);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment