Make sure to read the text after you guess, since the event tells you if you should guess higher or lower when you get the answer wrong, which allows you to use binary search to find the correct answer.
Binary Search : Basically always guess the middle number in the remaining possible range (Guess middle of 1-10 (5) on first try, if it tells you to go higher, guess the middle of 5-10 (8), if it tells you lower, guess the middle of 1-5 (3), and on and on.)
It should take at most 4 guesses to get the correct number, since there are only 10 options.

