[SOLVED]Flush serial input buffer

@pert
This is not cross posting. First i posted here. Look at the date and time. Then not getting answer decide to Open new account and ask in stackexchange too. And also mentioned right in the first line of my post in stackexchange that this question is also posted in forum.arduino.cc you are right in one thing that i should have been linked that sentence to this thread which i didnt do because couldnt find that button in editor.