Advertisement
Guest User

Untitled

a guest
May 27th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1. package hello.World;
  2.  
  3. public class Multiples2 {
  4.     public static void main(String[] args) {
  5.         int overallresult = 0;
  6.         for (int i = 0; i < 1000; i++){
  7.             if (i%3 == 0 || i%5 == 0){
  8.                 overallresult = overallresult+i;
  9.             }
  10.         }
  11.         System.out.println(overallresult);
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement