Skip to content

My while loop breaks my program

i am trying to write a simple hangman game in c it is only a prototype and when i run my code with my while loop in it i compile it and then run the exe in cmd and it instantly closes after running before any of the code is executed#include

int main(int argc, char const *argv[]) {
int Guesses = 0;
int MaxGuesses = 6;
int Completion = 0;
char UserGuess;
char Word[] = “fire”;

while (Guesses == MaxGuesses)
{
if (Completion == 4) {
printf(“You Wonn”);
break;
}

printf(“Please Enter Your Guess It Can Only Be A Letter Not A Wordn”);
printf(“The Word Is 4 Characters Longn”);