Output numbers using do while loop
import java.util.Scanner; public class AllNumDo { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Please enter the max number:"); int max = input.nextInt(); int i = 0; do {/*ww w . j av a 2s. com*/ System.out.println("Number " + i); i++; } while ( i <= max); } }