// // Loop4.java // // Loop: read one postive N and out 0-N between // until a negative is read // import java.util.Scanner; public class Loop4 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Input a positive (neg. to quit): "); int N; N = input.nextInt(); while(N>0) { for(int i=0; i<=N; i++) System.out.print(i + " "); System.out.println("\n\n"); System.out.print("Input a positive (neg. to quit): "); N = input.nextInt(); } } }