I think i've encounter a logic error. I'm unable to count the number of recurring word. Whatever word i type out, it counts, 766. Can someone help me up?
{
int i;
int count = 0;
char word[20];
printf("Convert Re-curring word to Uppercase\n");
printf("====================================\n\n");
for ( i =0 ;story[i] != '\0' ;i++)
{
printf("%c",story[i]);
_sleep(1);
}
printf("\n\nPlease enter the re-curring word you want to convert:");
gets(word);
printf("\nScanning for the word(%s) ",word);
printf("\n\n\tPlease Wait...");
_sleep(2500);
for (i=0;story[i] !='\0' ;i++)
{
count++;
}
printf("\n\n");
printf("The total number of recurring word \"%s\" is %d ",word,count);
printf("\n\n");