/* To copy the content of one file into another file*/ #include void main() { FILE *fp1,*fp2; char ch; fp1=fopen("abc.txt","r"); if(fp1==NULL) { printf("\n\tcan not open file"); exit(0); } fp2=fopen("xyz.txt","w"); if(fp2==NULL) { printf("\n\t can not open file"); exit(1); } while(ch!=EOF) { ch=fgetc(fp1); fputc(ch,fp2); } fclose(fp1); fclose(fp2); return 0; }
/*copy content from one file to another file*/ #include void main() { FILE *fp1,*fp2; char ch; fp1=fopen("abc.txt","r"); if(fp1==NULL) { printf("can not open a file"); exit(1); } fp2=fopen("xyz.txt","w"); if(fp2==NULL) { printf("can not open a file"); exit(2); } while(ch!=EOF) { ch=fgetc(fp1); fputc(ch,fp2); } fclose(fp1); fclose(fp2); return 0; }
/*copy the content of one file into another*/ #include void main() { FILE *fp1,*fp2; char ch; fp1=fopen("abc.txt","r"); if(fp1==NULL) { printf("can not open a file"); }exit(1); fp2=fopen("xyz.txt","w"); if(fp2==NULL) { printf("can not open a file"); }exit(2); while(ch!=EOF) { ch=fgetc(fp1); fputc(ch,fp2); } printf("file copide sucessfully"); fclose(fp1); fclose(fp2); }
/*to display the content of file*/
ReplyDelete#include
#include
void main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("/n/t cant open this file");
exit(0);
}
while(ch|=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
return 0;
}
#include
ReplyDelete#include
void main()
{
FILE *fp;
char ch;
if(fp==NULL)
printf("cant open file");
exit(0);
while(ch!=EOF)
{
ch=fgetc(fp);
printf("=%c",ch);
}
fclose(fp);
}
aaaa hawa!!!!!
Deleteay rada rada bhau
Delete#include
ReplyDelete#include
void main()
{
FILE *fp1,*fp2;
char ch;
fp1=fopen("abc.txt","r");
fp2=fopen("xyz.txt","w");
if(fp1==NULL)
{
printf("Error! cant open file");
exit(0);
}
if(fp2==NULL)
{
printf("Error! cant open file");
exit(1);
}
while(ch!=EOF)
{
ch=fgetc(fp1);
fputc(ch,fp2);
}
printf("File copied Successfully!");
fclose(fp1);
fclose(fp2);
}
/* To copy the content of one file into another file*/
ReplyDelete#include
void main()
{
FILE *fp1,*fp2;
char ch;
fp1=fopen("abc.txt","r");
if(fp1==NULL)
{
printf("\n\tcan not open file");
exit(0);
}
fp2=fopen("xyz.txt","w");
if(fp2==NULL)
{
printf("\n\t can not open file");
exit(1);
}
while(ch!=EOF)
{
ch=fgetc(fp1);
fputc(ch,fp2);
}
fclose(fp1);
fclose(fp2);
return 0;
}
/*to display the content of file*/
ReplyDelete#include
#include
void main()
{
FILE *fp1,*fp2;
char ch;
fp1=fopen("abc.txt","r");
if(fp==NULL)
{
printf("/n/t cant open this file");
exit(1);
}
fp2=fopen("xyz.txt","w");
if(fp2=NULL)
{
printf("cant open this file");
exit (2);
}
while(ch|=EOF)
{
ch=fgetc(fp1);
fputc(ch,fp2);
}
fclose(fp1);
fclose(fp2);
return 0;
}
/*copy content from one file to another file*/
ReplyDelete#include
void main()
{
FILE *fp1,*fp2;
char ch;
fp1=fopen("abc.txt","r");
if(fp1==NULL)
{
printf("can not open a file");
exit(1);
}
fp2=fopen("xyz.txt","w");
if(fp2==NULL)
{
printf("can not open a file");
exit(2);
}
while(ch!=EOF)
{
ch=fgetc(fp1);
fputc(ch,fp2);
}
fclose(fp1);
fclose(fp2);
return 0;
}
/*copy the content of one file into another*/
ReplyDelete#include
void main()
{
FILE *fp1,*fp2;
char ch;
fp1=fopen("abc.txt","r");
if(fp1==NULL)
{
printf("can not open a file");
}exit(1);
fp2=fopen("xyz.txt","w");
if(fp2==NULL)
{
printf("can not open a file");
}exit(2);
while(ch!=EOF)
{
ch=fgetc(fp1);
fputc(ch,fp2);
}
printf("file copide sucessfully");
fclose(fp1);
fclose(fp2);
}
#include
ReplyDeletevoid main()
{
FILE *fp;
char ch;
fp=fopen("abc.txt","r");
if(fp==NULL)
{
printf("/n/t cant open this file");
exit(0);
}
while(ch|=EOF)
{
ch=fgetc(fp);
printf("%c",ch);
}
fclose(fp);
return 0;
}
#include
ReplyDelete#include
void main()
{
FILE *fp1,*fp2;
char ch;
fp1=fopen("abc.txt","r");
fp2=fopen("xyz.txt","w");
if(fp1==NULL)
{
printf("Error! cant open file");
exit(0);
}
if(fp2==NULL)
{
printf("Error! cant open file");
exit(1);
}
while(ch!=EOF)
{
ch=fgetc(fp1);
fputc(ch,fp2);
}
printf("File copied Successfully!");
fclose(fp1);
fclose(fp2);
}
//copy the content of one file into another file
ReplyDelete#include
#include
void main()
{
FILE *fp1,*fp2;
char ch;
fp1=fopen("abc.txt","r");
if(fp1==NULL)
{
printf("\ncant open file");
exit(1);
}
fp2=fopen("*xyz.txt","w");
if(fp2==NULL)
{
printf("\ncant open a file");
exit(2);
}
while(ch|=EOF)
{
ch=fgetc(fp1);
fputc(ch,fp2);
}
printf("\nfile opened succesfully");
fclose(fp1);
fclose(fp2);
}
#include
ReplyDelete#include
void main()
{
FILE*fp1,*fp2;
char ch;
fp1=fopen("\nabc.text","r");
if(fp1==NULL)
{
printf("\ncan't open file");
exit(1);
}
fp2=fopen("xyz.text","w");
if(fp2==NULL)
{
printf("\n can't open file");
exit(2);
}
while(ch|=EOF)
{
ch=fgetc(fp1);
fputc(ch,fp2);
}
fclose(fp1);
fclose(fp2);
}
/*Reading content from file & Display*/
ReplyDelete#include
#include
void main()
{
FILE*fp1;
FILE*fp2;
char ch;
fp1=fopen("abc.text","r");
if(fp1==NULL)
{
printf("File not open");
exit(0);
}
fp2=fopen("xyz","w");
if(fp2==NULL)
{
printf("file not open");
exit(1);
}
while(ch|=EOF)
{
fgetc(fp1);
fputc(ch,fp2);
}
fclose(fp1);
fclose(fp2);
}
#include
ReplyDeletevoid main()
{
FILE *fp1,*fp2;
char ch;
fp1=fopen("p1.txt","r");
fp2=fopen("p2.txt","w");
if(fp1==NULL)
{
printf("Error! cant open file");
exit(0);
}
if(fp2==NULL)
{
printf("Error! cant open file");
exit(1);
}
while(ch!=EOF)
{
ch=fgetc(fp1);
fputc(ch,fp2);
}
printf("File copied Successfully!");
fclose(fp1);
fclose(fp2);
}
#include
ReplyDelete#include
void main()
{
FILE*fp1,*fp2;
char ch;
fp1=fopen("\nabc.text","r");
if(fp1==NULL)
{
printf("\ncan't open file");
exit(1);
}
fp2=fopen("xyz.text","w");
if(fp2==NULL)
{
printf("\n can't open file");
exit(2);
}
while(ch|=EOF)
{
ch=fgetc(fp1);
fputc(ch,fp2);
}
fclose(fp1);
fclose(fp2);
}
#include
ReplyDelete#include
void main()
{
FILE *fp1,*fp2;
char ch;
fp1=fopen("abc","r");
if(fp1==NULL)
{
printf("cant open a file ");
exit(9);
}
fp2=fopen("xyz","w");
if(fp2==NULL)
{
printf("cant open a file ");
exit(9);
}
while(ch!=EOF)
{
ch=fgetc(fp1);
fputc(ch,fp2);
}
fclose(fp1);
fclose(fp2);
}
#include
ReplyDelete#include
void main()
{
FILE *fp1,*fp2;
char ch;
fp1=fopen("abc","r");
if(fp1==NULL)
{
printf("Error! cant open file");
exit(0);
}
fp2=fopen("xyz","w");
if(fp2==NULL)
{
printf("Error! cant open file");
exit(1);
}
while(ch!=EOF)
{
ch=fgetc(fp1);
fputc(ch,fp2);
}
printf("File copied Successfully!");
fclose(fp1);
fclose(fp2);
}
take a look................
ReplyDelete#include
#include
void main() {
FILE *fp1, *fp2;
char ch;
clrscr();
fp1 = fopen("abc.txt", "r");
fp2 = fopen("xyz.txt", "w");
while (1)
{
ch = fgetc(fp1);
if (ch == EOF)
break;
else
putc(ch, fp2);
}
printf("File copied Successfully!");
fclose(fp1);
fclose(fp2);
}
/* copy of file */
ReplyDelete#include
#include
void main()
{
FILE *fp1,*fp2;
char ch;
fp1=fopen("string","r");
fp2=fopen("xyz","w");
if(fp1==NULL)
{
printf("can't open file");
exit(0);
}
if(fp2==NULL)
{
printf("can't open file");
exit(1);
}
while(ch!=EOF)
{
ch=getc(fp1);
putc(ch,fp2);
}
fclose(fp1);
fclose(fp2);
}