I'm writing a program that does a lot of things, but one of them is to check if the user input a 3 digit number then do stuff, but if a user input 2 or 4+ digit numbers then the program don't do any thing.
I wrote this chunk of code
do{
System.out.println("Enter a 3-digit number: ");
int input = scan.nextInt();
}while (input >= 100 || input < 1000);
but it doesn't check if the input is 3 digits.
So some help please.
This post has been edited by amture106: 09 October 2012 - 07:07 PM

New Topic/Question
Reply



MultiQuote




|