For your program you will modify the Guess Number program from the counter-controlled while loops program in the while Loops Part 1 lab. Use a for loop to allow the user up to 5 guesses. If their guess is correct use a break statement to exit the for loop.
instead of using the correct bool variable, you could break out of the for loop when the right number is guessed. You use a return statement, so the correct variable isn't really used.
At the moment you get the "Sorry you lost " message regardless.
The "Sorry you lost " message could be another else if condition.
Sorry, wasn't thinking straight - numGuesses only makes it to 5 after the for loop, so you need to compare to 4. Good to see you changed the assignment operator to an equality operator.
This should be sufficient:
elseif (numGuesses== 4)
I would prefer a comparison to test for a win rather than leave it for an else clause. The else can be for any other error - not that there should be any of those.
Also get rid of references to the correct variable on lines 12, 19 & 46.
And no need for the break before the return (have one or the other). If you want to have more code after the end of the for loop, then use the break.