0
The idea is to receive a 4 digit number and then perform a variety of accounts but there is an input condition: If in the middle of the 4 digits there is a character that is not a number then I need to print it.
Not using any methods.
I cannot perform the following code:
Receive an example entry: 3?56
Store {3, ? , 5 ,6} in an array without knowing which is the input.
Check if any of the array positions are not between 0 and 9.
In this case ? is not a number so print.
I wanted to save in the 4 positions of the array.
int i;
char [] digitos = new char[3];
digitos [0] =
digitos [1] =
digitos [2] =
digitos [3] =
for(i=0; i<digitos.length; i++);{
if(digitos[i]<(char)0||digitos[i]>(char)9) System.out.println("Digito "+digitos[i]+" invalido");
System.exit(0);
What have you tried? What language are you using?
– eightShirt
Java language.
– BFR
That’s it, I’m sorry
– BFR
Anyone can help?
– BFR