int smallest = minAndMax[0];
What is minAndMax[0] initialized to?
Set smallest to the largest possible value and largest to the smallest possible value.
int smallest = Integer.MAX_VALUE;
int largest = Integer.MIN_VALUE;
Normally, the default value an Integer will be initialized to will be 0 if you don't specify a value.
Unless you type in a negative number, you already have 0 in the smallest.
Uncomment the code in your first loop but don't use an else. Get rid of the second loop which has an error in the for statement - it's not needed.
for (int i = 0; i < minAndMax.length; i++)
{
if(minAndMax[i] > largest)
largest = minAndMax[i];
if (minAndMax[i] < smallest)
smallest = minAndMax[i];
}