fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone{
  9. public static void main (String[] args) throws java.lang.Exception{
  10. Scanner input = new Scanner(System.in);
  11. int num;
  12. System.out.println(" Enter 2 digit number");
  13. num = input.nextInt();
  14. while(num < 10) {
  15. System.out.println("Enter 2 digit number");
  16. num = input.nextInt();
  17. while(num > 99) {
  18. System.out.println("Enter 2 digit number");
  19. num = input.nextInt();
  20. }
  21. }
  22. System.out.print("Your number is:" + num);
  23. }
  24. }
Success #stdin #stdout 0.1s 380736KB
stdin
100
1001
50
stdout
 Enter 2 digit number
Your number is:100