This is my code so far and it’s for a basic Java class. Thepurpose for the code is to prompt the user for 10 integers and thendisplay the largest and smallest integer that was inputed. I wasable to ask the user for the 10 integers and display the largestnumber; however, the smallest number isn’t shown. It just displaysthat the smallest integer is 0.
![E import java.util.Scanner; public class Largesmall public static void main (String [] args) int counter 1; int largest = 0; int smallest 0; int number0; Scanner input- new Scanner(System.in); while (counter <= 10) { System.out.print (Enter number: ); number -input.nextInt); if (number largest) largest number; Jelse if(numbersmallest) smallestnumber; Jelse System.out.print(Number isnt distinct) countercounter 1; System.out.println(Largest number is: + largest); System.out.println( Smallest number is: smallest);](https://media.cheggcdn.com/media%2F923%2F92392839-eb81-4485-943a-c3e436591365%2FphpBdZ3mG.png)
E
PayPal Gateway not configured
PayPal Gateway not configured