/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package nestedloop; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * * @author print depot */ public class Loop { public static void main(String arg[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int num=0; System.out.println("Enter a number to count between 0-10:"); num =Integer.parseInt(br.readLine()); if (num>0&& num<10) { for(int i=1; i<=num; i++){ //for(int j=0; j<=num; j++){ System.out.print(i); // } } } else { System.out.print("The number you entered is not between 0-10"); } } }