fork download
  1. // your code goes here
  2. let count = 0;
  3. for(let i = 1; i <= 25; i++) {
  4. if(i % 3 === 0 || i % 5 === 0) {
  5. count = count + i;
  6. console.log(i)
  7. }
  8. }
  9.  
  10. console.log("Jumlah total:", count);
Success #stdin #stdout 0.02s 16476KB
stdin
Standard input is empty
stdout
3
5
6
9
10
12
15
18
20
21
24
25
Jumlah total: 168