// // Loop2.java // // Loop: read two postives and out all numbers between // until two negatives were read // import java.util.Scanner; public class Loop2 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Input two positives (neg. to quit): "); int a, b; a = input.nextInt(); b = input.nextInt(); while(a>0 && b>0) { for(int i=a; i<=b; i++) System.out.print(i + " "); System.out.println("\n\n"); System.out.print("Input two positives (neg. to quit): "); a = input.nextInt(); b = input.nextInt(); } } }