Spent so long trying to figure out what's wrong, I am new to Java and basically a beginner programmer, making the answer simple for me to understand will be greatly helpful. Thank you.
import java.util.Scanner;
public class CheckingTheAge {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("How old are you?");
int age = Integer.valueOf(scanner.nextLine());
if ( age => 0 && age =< 120) {
System.out.println("OK");
} else {
System.out.println("Impossible!")
}
}
}
Aucun commentaire:
Enregistrer un commentaire