#include<stdio.h>
#include<conio.h>
void main()
{
   FILE *fp;
   char str;
   fp=fopen("old.txt","r+");
   clrscr();
   while(fscanf(fp,"%s",str)!=EOF)
   {
      if(strcmp(str,"three")==0||strcmp(str,"bad")==0||strcmp(str,"time")==0)
      {
         printf("");
      }
    else
        printf("%s
",str);
 }
fclose(fp);
getch();
}
Note: Create a text file old.txt in same folder and write some words including three, bad and time.

0 comments:
Post a Comment