Codigo :
public static void ejercicio(){
char c = teclado.next().charAt(0);
if((c == 'a')|| (c == 'e') || (c == 'i') || (c == 'o') || (c == 'u')){
System.out.println(c + " es un vocal.");
}
else {
if(c >= 'a' && c <= 'z'){
System.out.println(c + " es un constante.");
}
else System.out.println("ERROR");
}
}
No comments:
Post a Comment