Monday 27 August 2012

C program code | file handling with fopen using while loop

C program code     | file handling  with fopen using while loop
#include<stdio.h>
void main()
{
 FILE *f1,*f2,*f3;
 char c;
 clrscr();
 printf("input text");
 f1=fopen("cmb.txt","w");
 f2=fopen("cmb01.txt","w");
 f3=fopen("cmb02.txt","a");
 while((c=getchar()) != EOF)
 putc(c,f1);
 f1=fopen("cmb.txt","r");
 while((c=getc(f1)) !=EOF)
 printf("%c",c);
 fclose(f1);
 while((c=getchar()) != EOF)
 putc(c,f2);
 fclose(f2);
 f2=fopen("cmb01.txt","r");
 while((c=getc(f2)) !=EOF)
 printf("%c",c);
 fclose(f1);
 fclose(f2);

 }
programming example for C program code     | file handling  with fopen using while loop
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: