All pastes #541820 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-05 16:49 UTC
rendered paste body
#include<stdio.h> 
main() 
{
   FILE *f1,*f2;
   char ch1,*ch;
   char temp[4]="New";
   f1=fopen("ex.c","r");
   f2=fopen("ww.c","w"); 
  while(!feof(f1))
   {
       fscanf(f1,"%s",ch);
       if(strcmp(ch,"Delhi")==0)
      {
          fprintf(f2,"%s",temp); 
          fprintf(f2," ");
     }
      fprintf(f2,"%s",ch);
      fprintf(f2," ");
    } 
    fclose(f1);
    fclose(f2);
   f1=fopen ("ex.c","w"); 
   f2=fopen ("ww.c","r");
  while(!feof(f2))
  { 
       ch1=fgetc(f2);
       fputc (ch1, f1);
 }
 fclose(f1); 
fclose(f2);
 }