@adhpawal  The user can only exit the system by entering 0 when he/she is prompt.. I have implemented the code in this way... so even if user guesses correct number.. he/she has to enter 0 explicitly in order to exit.