Scanner scan = new Scanner (System.in); int tal; while (tal != 0){ System.out.print("Skriv in ett heltal: "); tal = scan.nextInt();