How can I program/code for 'user input' and 'conditional statements' together in java?

10/21/2019 5:45:23 AM

Avick Saha

1 Answer

New Answer


boolean x; System.out.println("Enters the two digit number"); while (x==false) { int num=in.nextInt(); if(num>9 && num<101) x=true; else System.out.println(num+" is not a 2-digit number try again); } /*For user input, the conditional statements could be inserted in while loop*/