Serial.read()

void setup()
{
Serial.begin(9600);
while(!Serial){}
Serial.println("Enter the number");
int a=Serial.read();
Serial.print("The number is ");
Serial.print(a);
}
void loop()
{
}

Serial.read() is being ignored, iam not able to read through the serial monitor. Is the code right?

There is some simple user-input code in Planning and Implementing a Program

...R

Also, note

while(!Serial){}

is useless on all the "normal" Arduino's like the Uno.

And please read How to use the forum before you make another post :wink: