I am creating a prototype of the gallows game. I do not understand much of programming and I have a problem with what is returned. The part of the code that is giving problem and that is below returns me twice the "Type a letter:". Can anyone 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] != ' for(chance = 1; chance <= 10; chance++)
{
printf("\n");
printf("Digite uma letra: ");
scanf("%c", &letra);
printf("\n");
for(i = 0;word[i] != '%pre%';i++)
{
if(letra == word[i])
{
var[i*2] = letra;
}
}
printf("%s\n", var);
';i++)
{
if(letra == word[i])
{
var[i*2] = letra;
}
}
printf("%s\n", var);