hello there, i got problem with my code, when i starting to guess a letter and hit the enter, the letter i've guess is not printing in the blank i made. can someone help me to fix the code? thanks.
Code:int main(){ int i; int j; int x=0; char word[30]; char undscr[30]; char length; char letter; printf("enter a word: "); gets(word); length=strlen(word); undscr[x]='_'; for(i=0;i<length;i++) { printf(" %c", undscr[x]); } printf("\n\nguess the letter: "); scanf("%c", &letter); for(j=0;j<i;j++) { if(letter==word[i]) { undscr[i]=word[i]; } } getch(); return 0; }



LinkBack URL
About LinkBacks



