Skip to content

Instantly share code, notes, and snippets.

@Wilfred
Created September 5, 2009 16:12
Show Gist options
  • Save Wilfred/181453 to your computer and use it in GitHub Desktop.
Save Wilfred/181453 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(void) {
int i, total=0;
for (i=0; i<1000; i++) {
if (i % 3 == 0 || i % 5 == 0) {
total += i;
}
}
printf("Total is %d\n",total);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment