re: Project Euler #1 - Multiples of 3 and 5 VIEW POST

FULL DISCUSSION
 

Hi, I am adding my first thought on this in Java.

private int sum(int inputValue) {
int sum = 0;
for (int i = 1; i < inputValue; i++) {
if (i % 5 == 0 || i % 3 == 0) {
sum += i;
}
}
return sum;
}

code of conduct - report abuse