Respuesta :
The program is an illustration of loops
What are loops?
Loops are program statements that are used to execute repeated statements
The java program
The program, written in Java where comments are used to explain each line is as follows:
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int num;
//Get input from the user
num = input.nextInt();
//Initialize the largest to the first input
int maxn = num;
//This loop is repeated until a negative input is recorded
while (num >=0){
//If the current input is greater than the previous largest
if (num>maxn){
//Set largest to the current input
maxn = num; }
//Get another input from the user
num = input.nextInt();
}
//Print the largest
System.out.print("Largest: "+maxn);
}
}
Read more about loops at:
https://brainly.com/question/14284157