I am learning Java and I do not know what makes my code not reading my else-if condition (i == 5)

```
int i;    
for (i = 1; i <= 5; i++) {
    int guess = scanner.nextInt();
    System.out.println("Attempt: " + i +"/5");
    if (guess < numberToGuess) {
        System.out.println("Higher");
    } else if (guess > numberToGuess) {
            System.out.println("Lower");
    } else if (i == 5) {
        System.out.println("You failed! The correct answer is " + numberToGuess);
    } else {
        System.out.println("You won! Your answer is " + numberToGuess + " which is correct!");
        break;
    }

```

when i'm running the code and try to fail the game by reaching the maximum number of int i which is 5, the second else if statement should appear but it is not working.

I just don't get the reason why it is not reading the (i==5) condition, all of the other conditions are working except that.