Wrong analogRead values

Try this: (Compiled but untested.)

const int numReadings = 100;
const int analogInPin = A0;  
int inputReading [numReadings];

void setup() 
{
  Serial.begin(115200); 
}

void loop()
{
  for (int i = 0; i < numReadings; i++) {
    inputReading [i]= analogRead(analogInPin); // roughly 9kHz sampling
  }
  
  for (int i = 0; i < numReadings; i++) {    
    float voltage = ((inputReading[i]/1023.0)*5.0);                             
    Serial.println(voltage);  
  }
}

Unplug it! It'll go to zero. (or pretty close) 8)

Learning:
Unplug it! It'll go to zero. (or pretty close) 8)

Bonus marks to Learning if you can explain why those sunglasses are unearned. 8)

(Hint: have you tried it?)

Learning:
Unplug it! It'll go to zero. (or pretty close) 8)

No it won't it will float which is why I suggested you need a load resistor. So why have you not tried this.
Better still put the scope lead on the analogue input and run the code again. Is it different than when the scope is disconnected.

AWOL:
Try this: (Compiled but untested.)

const int numReadings = 100;

const int analogInPin = A0; 
int inputReading [numReadings];

void setup()
{
  Serial.begin(115200);
}

void loop()
{
  for (int i = 0; i < numReadings; i++) {
    inputReading [i]= analogRead(analogInPin); // roughly 9kHz sampling
  }
 
  for (int i = 0; i < numReadings; i++) {   
    float voltage = ((inputReading[i]/1023.0)*5.0);                             
    Serial.println(voltage); 
  }
}

I tried connecting a 10k resistor as someone suggested. And it WORKED !. I uploaded your code for fun and it also works. Its a bit better than mine.... :frowning:

I tried connecting a 10k resistor as someone suggested. And it WORKED

As some one once said, tell me when I am wrong not when I am right 8)

Cool glasses justified I think.