Answer:
You would need a while (true) loop, aka a loop that always runs, OUTSIDE this loop, you would need to generate a random number. Inside the loop, you need to wait for user input and then compare it against the answer variable you generated outside the loop. Then, if the answer is not right, you would need to tell them that and go back to the beginning of the loop. If it is, you need to break the loop and continue. Operators I would use: == to check if answer is equal to number generated.
Program purpose: Fun game about guessing a random number
Useful in real world: (I can't think of anything for this one)
Errors: I didn't run into any errors.
Differently: I think I wrote my program as efficiently as I could.
Step-by-step explanation:
I could program this "game" for you if you tell me what language it needs to be made in. I.E Python, C++, lua, etc.
Good luck! P.S, Please do not COPY + PASTE this answer, it will most likely be found by whoever is checking this. There is 1-2 things in there you will need to change to your liking.