Emerson interview question

write a program for a number game and explain it!