When I start this program, for example I put value 11, I do not get into the conditional if ((valor >10)&&(valor <20))
, why can it be?
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author carlos
*/
import java.util.Scanner;
public class UsoCondiciones {
public static void main (String[]args){
Scanner Scan = new Scanner (System.in);
int valor =0;
valor = Scan.nextInt();
if((valor >0)&&(valor<10)){
Scan.nextLine();
System.out.println("Valor del 1 al 9");
if ((valor >10)&&(valor <20)){
System.out.println("Valor del 10 al 19");
if ((valor >= 20)&&(valor<30)){
System.out.println("Valor del 20 al 29");
}
}else{
System.out.println("Incorrcete");
}
}
}
}