"guess the number" game in various programming languages
program picks a random number between 1 and 100, and asks user to guess it.
for each guess, program gives feedback on the number entered by user, whether it is smaller, larger or equal.
guess a number between 1 and 100
> 50
too low!
> 75
too high!
> 67
too low!
> 73
too high!
> 70
that's right!
any random number between 1 to 100 can be guessed in maximum of 7 turns by applying binary search logic.