import java.util.*;
public class test {
public static void main (String[] args) {
System.out.println("Guess how old I am");
Scanner scan = new Scanner(System.in);
int myAge = 16;
int guessedAge = scan.nextInt();
if (myAge < guessedAge) {
System.out.println("lower!");
} else if (myAge > guessedAge) {
System.out.println("higher!");
} else if (myAge == guessedAge) {
System.out.println("correct");
}
}
}
I know that this is just for one try. You guess and it gives you only one output. I want that it works until the right age is guessed but i can't put it in a while loop because it will spam the output of one
