how to display the array eg: [10, 3, 5, 0, 0, 0, 0, 0, 12, 72] from sensor

how to display the array in the form of, for example: [10, 3, 5, 0, 0, 0, 0, 0, 12, 72] in the serial monitor? The input will be coming from analog sensor

const unsigned int numReadings = 10;
unsigned int analogVals[numReadings];

void setup()
{
}

void loop()
{
  //take numReadings # of readings and store into array
  for (unsigned int i=0; i<numReadings; i++)
  {
    analogVals[i] = analogRead(A0);
    delay(1000); //wait 1 sec
  }

}

 Serial.print("[");
  for (int x = 0; x < numReadings - 1; x++)
  {
    Serial.print(analogVals[x]);
    Serial.print(",");
  }
  Serial.print(analogVals[numReadings - 1]);
  Serial.println("]");

Did you put the code in an Arduino sketch with setup(), loop() etc ?

Here is a complete program

unsigned int analogVals[] = {10, 3, 5, 0, 0, 0, 0, 0, 12, 72};
const byte numReadings = sizeof(analogVals) / sizeof(analogVals[0]);

void setup()
{
  Serial.begin(115200);
  Serial.print("[");
  for (int x = 0; x < numReadings - 1; x++)
  {
    Serial.print(analogVals[x]);
    Serial.print(",");
  }
  Serial.print(analogVals[numReadings - 1]);
  Serial.println("]");
}

void loop()
{
}