Well, I compiled your code and entered the number 119 and it printed out:
" not a prime
Prime number"
Do you need help or just mocking us?
Can you explain the algorithm you're using for this?(only if you're willing to, there's no pressure)

[QUOTE]I AM USING TURBO C To Write This Programe [/QUOTE]
I think You should get another compiler, may be [URL="

WaltP commented: And by getting a 'better compiler' he fails the class. Great idea! :( -4

Using fgets.
[CODE]

include <stdio.h>

include <string.h>

include <stdlib.h>

include <ctype.h>

int main()
{
FILE txt_file;
const char
substring ="in";/search word/
int word_match=0,l=strlen(substring);

   char sentence[25];/*to save the line read from the file)*/

   if((txt_file=fopen("text.txt","r"))==NULL)
       {
           printf("Can't open the file\n");
           exit(1);
        }

   while(fgets(sentence,sizeof(sentence),txt_file) )
       {
           /*printf("%s\n",sentence);/*testing! testing!*/
           char* r_string=strstr(sentence,substring);

           if(r_string!=NULL)
                          {
                             word_match++;
                          }
                }

   fclose(txt_file);
       printf("Matched words:%d\n",word_match);
       return EXIT_SUCCESS;
}[/CODE]

strstr returns every string that matches the substring.
For example, here I searched for the word 'in' and it returned all the strings containing the characters 'in'.
Though, this may be compulsory in some cases (searching DNA sequences for example),
it is little bit annoying while searching for a "word" in a text.

WaltP commented: Fix your formatting!!!!! -4