Why is the third condition not satisfied?
package com.codegym.task.task04.task0419;
/*
Maximum of four numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int num1 = Integer.parseInt(br.readLine());
int max = num1;
for (int i = 0; i < 3; i++) {
int num2 = Integer.parseInt(br.readLine());
if(num2 >= num1){
max = num2;
}else{
max = num1;
}
}
System.out.println(max);;
}
}