Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions euler1.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <math.h>

static unsigned long total;

Expand All @@ -13,13 +14,13 @@ int main(void)
for(unsigned int j = 1; j < 1000; j++){

if(j%5==0 && j%3!=0){
total = total + j;
total += j; //total
}else{
total = total + 0;
total = total;
}
}

printf("Project Euler problem 1 solution = ");
printf("Project Euler problem 1 solution is ");
printf("%lu \n", total);

return 0;
Expand Down