Hi,
I am making a program where the user has to input an integer with LESS than 5 digits.
If he enters more than 5 digits, I want the program to print: "ERROR"
How can I do that?
I wrote this code till now. Do I have to use a for loop? If yes what should I write in it?:)
Scanner input = new Scanner(System.in);
int number = 0;
System.out.print("Enter a number with less than five digits:");
number = scan.nextInt();
for(int counter=0;counter<=5;counter++){
}