Need assitance inputting separate values via serial monitor and keyboard

I am trying to read multiple numbers from the serial input using int x = Serial.parseInt()
I am using a for loop to try to get indexed values x(i) . The arduino compiler will not let me use x(i) as a function in Serial.println(x(i));
How can I enter multiple data values and assign them to an indexed variable x for retrieval later?

int i;
int x;
	
	void setup ()
	{
	int i;
	int x;
	Serial.begin(9600); // Sets up communication with the serial monitor
	}
        
           
void loop() 
{ 
     
       {
         for (i=0; i <  4; i++) 
      // if (Serial.available()>0) 
		{
                  int x = Serial.parseInt();
		  Serial.print("i ="); Serial.println(i);
                   Serial.print("x(i) = "); Serial.println(x(i));
                } 
 
   }                                                
}

first of all x needs to be an array, with an appropriate length:

int x[4]

secondly, you need to use the square brackets to indicate index position

Serial.println(x[i]);

And then there are a few other issues as well, but this should get you started.

Thanks for the info.

TRex: secondly, you need to use the square brackets to indicate index position

Serial.println(x([i]);

And then there are a few other issues as well, but this should get you started.

There is an extra '(' in there. I suggest you correct it, to avoid confusion.

The below is some very simple code for capturing a string of characters that represent a numeric value, and converts what is captured into a numeric value for use to control a servo.

//zoomkat 7-30-10 serial servo test
//type servo position 0 to 180 in serial monitor

String readString;
#include <Servo.h> 
Servo myservo;  // create servo object to control a servo 

void setup() {
  Serial.begin(9600);
  myservo.attach(9);
  Serial.println("servo-test"); // so I can keep track of what is loaded
}

void loop() {

  while (Serial.available()) {
    char c = Serial.read();  //gets one byte from serial buffer
    readString += c; //makes the String readString
    delay(2);  //slow looping to allow buffer to fill with next character
  }

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured String 
    int n = readString.toInt();  //convert readString into a number
    myservo.write(n);
    readString="";
  } 
}