Serial.available

I follow the example from arduino

int incomingByte = 0; // for incoming serial data

void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}

void loop() {

// reply only when you receive data:
if (Serial.available()) {
// read the incoming byte:
incomingByte = Serial.read();

// say what you got:
Serial.println(incomingByte);
}
}

but after I press "Enter"
I receive a 10

and if I type a number
I receive a number and a 10
15:57:53.769 -> 53
15:57:53.769 -> 10

how can I solve this?

but after I press "Enter"
I receive a 10

You have got the Line ending in the Serial monitor set to Newline. The ASCII code for Newline is 10. That is what you are seeing

If you want “echoing”, use serial.write(), instead of print.

I changed my serial monitor option to “No line ending” mode