This is a simple guess the number program. I am trying to put an option that asks the user "Would you like to play again? (y or n). If the user press the y it should start the loop again but I can't find out the logic. Can I have some help please?
return in main ends the program. it that is a zero, it is normal execution, otherwise, it is an error code.
so your line 26 returns an error code (of 1, which is bool == true's int value).
just remove the whole 'y' block. if they enter a 'n', exit, if not, keep going.
I think you also may want to have it tell you what to do after the 'y', so you need a little editing to clean it up after you get the y loop working