I have a menu as shown in the picture below.
I'm waiting for an input from the user to choose one of the three. But when user enters something, for example 2, it gets displayed in the console and it waits for the user to press enter. But I want it such that when the user hits a number, the menu disappears instantly. How do I do that?

 
     
     
    