You are on page 1of 1

import java.util.

Scanner;

public class BreakWhileLoop {

public static void main(String[] args) {


int n;

Scanner input = new Scanner(System.in);

while (true) {
System.out.println("Input an integer");
n = input.nextInt();

if (n == 0) {
break;
}
System.out.println("You entered " + n);
}
}

You might also like