Skip to content

Instantly share code, notes, and snippets.

@jingning42
Created September 28, 2014 01:08
Show Gist options
  • Save jingning42/6cb043a578bec4deb07a to your computer and use it in GitHub Desktop.
Save jingning42/6cb043a578bec4deb07a to your computer and use it in GitHub Desktop.
Project_Euler#1.c
#include <stdio.h>
int main() {
int sum = 0, num;
for (num = 0; num < 1000; num ++){
if (num % 3 == 0 || num % 5 == 0){
sum = sum + num;
}
}
printf("sum = %d",sum);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment