Created
October 18, 2012 10:21
-
-
Save a1phanumeric/3910889 to your computer and use it in GitHub Desktop.
Project Euler - Problem 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(){ | |
int i; | |
int total; | |
for(i = 0; i<1000; i++) total+=(i%3==0 || i%5==0) ? i : 0; | |
printf("%i", total); | |
printf("\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment