Typing a number into the serial port and displaying it on the monitor?

Okay so here is my problem. I want to type a number into the serial port and display it on the monitor. Now, I can do this for 0-9, however, when I try to type a multiple digit number, say 23, it reads and displays it one number at a time.

For example: I type 23 into the port and send it.

Monitor: (this is what I see in the monitor)

2
3

What I would like to see in the monitor:

23

Here is my code:

char val;

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

void loop() {
 if(Serial.available()){
 val = Serial.read();
 Serial.println(val);
 delay(100);
 } 

}

How can I achieve this?

Keep in mind I am an absolute noob at programming.

Try:

int val;

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

void loop() {
 if(Serial.available()){
   val = Serial.parseInt();
 Serial.println(val);
 delay(100);
 }

}

https://www.arduino.cc/reference/en/language/functions/communication/serial/parseint
Also:

That does work, though there is about a 1 second delay. Is there anyway to make this more quick? I'm going to try and control a robot.

Read my second url, thoroughly.

Taking me a while to reason through the code but I am starting to understand the concepts a little better. I’ll keep at it. Thanks!