Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Multiples of 3 and 5
import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int number = 1000; System.out.println(Divisibility(number)); } public static int Divisibility(int number){ int sum = 0; for ( int i = 1; i < number; i++) if ( (i % 3 == 0) || (i % 5 == 0) ) sum += i; return sum; } }
run
|
edit
|
history
|
help
0
Has A
App
Main.java
test1
Rabbits in forest (leetod)
collectors and stream
Java Lambda Expression Sample
jb6.13 varargs
Kochergina_2
LunarLanding.java