vaskell

Q9 — Squares Loop

Jan 26th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  1. public class MultiplesLoopRange {
  2.         public static void main( String[] args ) {
  3.             int start = Integer.parseInt (args [0]);
  4.             int end = Integer.parseInt (args [1]);
  5.             int factor = Integer.parseInt (args [2]);
  6.                 for (int x = start; x <= end; x++) {
  7.                     if (x % factor == 0) {
  8.                     System.out.print (x + " ");
  9.                 }
  10.             }              
  11.         }
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment