28. Copy the content of one file from the other file and display the contents.


Comments

  1. pandhare Dipali11:41 AM

    /*to display the content of file*/
    #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;
    }

    ReplyDelete
  2. Ranjit kalubarme11:43 AM

    #include
    #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);
    }

    ReplyDelete
    Replies
    1. unknown12:07 PM

      aaaa hawa!!!!!

      Delete
    2. unknown12:11 PM

      ay rada rada bhau

      Delete
  3. #include
    #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);
    }

    ReplyDelete
  4. Waghmare Swati11:58 AM

    /* 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;
    }

    ReplyDelete
  5. pandhare Dipali12:00 PM

    /*to display the content of file*/
    #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;
    }


    ReplyDelete
  6. poonam pusavale12:04 PM

    /*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;
    }

    ReplyDelete
  7. Wadegonkar Aishwarya12:08 PM

    /*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);
    }

    ReplyDelete
  8. puja khandare12:13 PM

    #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;
    }

    ReplyDelete
  9. Sayali Daunde12:15 PM

    #include
    #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);
    }

    ReplyDelete
  10. Dipali Kore12:18 PM

    //copy the content of one file into another file
    #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);
    }

    ReplyDelete
  11. sonali nagane12:18 PM

    #include
    #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);
    }

    ReplyDelete
  12. Bhanvase Yashoda12:22 PM

    /*Reading content from file & Display*/
    #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);
    }












    ReplyDelete
  13. Radha ghadge12:25 PM

    #include
    void 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);
    }

    ReplyDelete
  14. mayuri magar12:26 PM

    #include
    #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);
    }

    ReplyDelete
  15. #include
    #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);

    }

    ReplyDelete
  16. Bhosale Dhanashri SE39:57 AM

    #include
    #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);
    }


    ReplyDelete
  17. mubin pirjade10:59 AM

    take a look................
    #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);
    }

    ReplyDelete
  18. sachita jadhav11:23 AM

    /* copy of file */
    #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);
    }

    ReplyDelete

Post a Comment