I am trying to make this program, where the user will try to guess what my name is and it will check. If the user guesses it correct, it should only print: "You guessed Max Zaloznyi". And I have another cout like that, if they guess wrong. When you guess correct, it prints the same cout twice, which I don't want. How can I fix this? Hopefully this makes sense.
I think you want the block of statements after the else statement to be a part of the first if case.
Unless you want them to execute regardless then you can either add another if statement for the second cout You Guessed statement or erase the first cout You Guessed statement under the if condition and change the if condition to check NOT strcmp instead of strcmp.