I am writing a program that uses a while loop to determine the largest number input so far. I have to input 10 numbers in whole. At the end of the loop, it should output the largest number.
import java.util.Scanner;
public class Largest
{
public static void main(String[] args)
{
int counter = 1;
int number;
int largest;
int number2;
Scanner input = new Scanner(System.in);
while (counter < 10)
{
System.out.println("Enter a number");
number = input.nextInt();
// ???
}