Hi aussiemcgr thanks again for your quick reply. I do see what you are saying however if I remove that statement I am back to where I started where if the first number entered is the smallest number, min1 and min2 will be displayed as that number. For example...
for (int i=1; i<numin; i++) {
System.out.print ("Number " + (i+1) + ": ");
int num2 = input.nextInt();
// Series of conditional statements that determines what the minimum values
// entered by the user are.
if (num2 <= min1) {
min2 = min1;
min1 = num2;
} else if (num2 < min2) {
min2 = num2;
// } else if (min1 == min2) {
// min2 = num2;
}
}
// Prints the two minimum integers that the user input
System.out.println("The two smallest numbers are " + min1 + " and " + min2);
}
}
Gives me...
How many numbers would you like to enter? 4
Number 1: 1
Number 2: 2
Number 3: 2
Number 4: 2
The two smallest numbers are 1 and 1
When the two smallest numbers should be 1 and 2.
Any more suggestions?
Thanks again