3
I’m creating a prototype hangman game. I don’t know much about programming and I have a problem with what is returned. The part of the code that is giving problem and below returns me twice the "Type a letter: ". Someone knows tell me the reason?
for(chance = 1; chance <= 10; chance++)
{
printf("\n");
printf("Digite uma letra: ");
scanf("%c", &letra);
printf("\n");
for(i = 0;word[i] != '\0';i++)
{
if(letra == word[i])
{
var[i*2] = letra;
}
}
printf("%s\n", var);