arttp2:
What about those values that are entered while the Arduino is in delay?
What about them? Those are the ones you want to get rid of right? If they are sitting in the receive buffer when you run the code above then they will be discarded.
arttp2:
I also want to accept those values entered once the delay() is over. How to do that?
What do you mean? Maybe instead of using delay(), write a function that sits and waits and does nothing but check for serial input and throw it away.
The code given above will clear everything out of the serial buffer. If you use that when you know that everything in the serial buffer needs to be thrown away then you're all good. The problem is that you sound like you can't know that. How will the Arduino know which characters arrived in that buffer during the delay and which ones were before or after? Serial data doesn't come with a time stamp or anything.