here the termination for a word that am gonna keep is 'space' , '.' & ','
Code:
#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fpointer;
char ch,ch1[25];
int i=0,flag=0;
fpointer=fopen("ur file name","r");
while(1)
{
  ch=fgetc(fpointer);
    
        if(!ch^' ' || !ch^'.' || !ch^','||!ch^EOF)
        {
              if((!flag^0) && !ch^EOF)
              {
                 printf("no word found in the file");
                 break;
              }
              else if(!ch^EOF)
              { 
                ch1[i]='\0';
                printf("%s\n",ch1);
                break;
              }
              else
             {
                 if(flag^0)
                 {
                     ch1[i]='\0';
                     printf("%s\n",ch1);
                     i=0;
                 }
             }
         }
         else 
         {
            flag=1;
            ch1[i]=ch;
            i++;
         }
    }
 }
fclose(fpointer);
getch();
}

Last edited by shabbir; 5Oct2009 at 09:52.. Reason: Code blocks