Guest User

Untitled

a guest
Jul 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. public class q1multiplesof3and5 {
  2.  
  3. public static void main(String args[]) {
  4. int sum = 0;
  5. for(int i = 0; i < 1000; i++){
  6. if(i%3 == 0 || i%5 == 0){
  7. sum+= i;
  8. }
  9. }
  10. System.out.println(sum);
  11. }
  12. }
Add Comment
Please, Sign In to add comment