/** * Examples of using a while loop * * Hunter Lloyd * */ import java.util.Scanner; public class WhileXample { public static void main(String [] args) { int a = 0; //how many times will this run, what is the output? while(a <5) { System.out.println(a++); } Scanner input = new Scanner(System.in); System.out.println("Give a new number"); a = input.nextInt(); while(a < 25) { System.out.println(a++); } a=1; while(a != 0) { System.out.println("Give a new number"); a = input.nextInt(); System.out.println(a); } } }