good day to all, can anyone help me how can my program read if a letter is inputted again it prompts "letter inputted already"? heres my code:
#include <stdio.h>
#include <string.h>
#include <conio.h>
int main()
{
char alphabet[26] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char letter;
int i;
for(i = 0; i < 26; i++)
{
printf("%s\n\n", alphabet);
printf("Choose a letter: ");
letter = getchar();
printf("\n\n");
for(i = 0; i < 26; i++)
{
if (letter == alphabet[i])
{
alphabet[i] = '_';
break; /* This terminates the for() loop */
}
}
printf("Result: %s\n", alphabet);
}
}