[B]What is Program about?[/B] I am working on this program which will keep getting input from user until 0 is entered. when 0 is entered program will show which was the largest and the smallest number of all the numbers entered. [B]What is the error?[/B] Program below works and when I enter 0 it shows the largest value but shows 0 as the smallest value. Example: if i enter few values like 5, 10, 15 and than enter 0 to get the results, it shows the correct largest number which in this case is 15 but shows 0 as the smallest number which in this case is 5. How can that be corrected? import java.util.Scanner; public class LargestAndSmallest { public static void main(String [] args) { int number; int largeNumber = 0; int smallNumber = 0; Scanner s = new Scanner(System.in); System.out.println("Enter multiple numbers\n" + "and enter 0 to get the result of\n"+ "largest and smallest numbers entered"); System.out.print("Enter a number or 0 to end or get results: "); number = s.nextInt(); while (number != 0) { System.out.print("Enter a number or 0 to end or get results: "); number = s.nextInt(); if(number < smallNumber ) smallNumber = number; if (number > largeNumber ) largeNumber = number; } System.out.println(smallNumber); System.out.println(largeNumber); } }