TO COPY ONE FILE INTO ANOTHER WHILE DOIING SO REPLACE ALL LOWER CASE INTO UPPER CASE


#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fp,*fq;
char ch,c;
clrscr();
fp=fopen("a.txt","r");
fq=fopen("b.txt","w");
if(fp==NULL)
{
printf("file does not exist");
exit(0);
}
if(fq==NULL)
{
printf("file does not exist");
exit(0);
}
while(1)
{
ch=fgetc(fp);
if(ch==EOF)
 break;
if(islower(ch))
{
c=toupper(ch);
fputc(c,fq);
}
}
fclose(fp);
fclose(fq);
getch();
}

0 comments: (+add yours?)

Post a Comment