analogRead() output oscillates even though the pin is grounded
You have nothing in your setup loop. You need to set up all the inputs as inputs.

You setup() should look like this:

void setup() 
 {
   Serial.begin(9600);
   for (int i = 0; i &lt; 5; i++);
    {
      pinMode(input[i], INPUT);
    }
 }


The code cycles through your array "input", setting all the pins as inputs. Try that.