logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming See What Others Are Saying!
  • Question
  • Write a c program to copy a data of file to other file.


  • Correct Answer
  • #include int main(){ FILE *p,*q; char file1[20],file2[20]; char ch; printf("\nEnter the source file name to be copied:"); gets(file1); p=fopen(file1,"r"); if(p==NULL){ printf("cannot open %s",file1); exit(0); } printf("\nEnter the destination file name:"); gets(file2); q=fopen(file2,"w"); if(q==NULL){ printf("cannot open %s",file2); exit(0); } while((ch=getc(p))!=EOF) putc(ch,q); printf("\nCOMPLETED"); fclose(p); fclose(q); return 0; } 


  • More questions

    • 1. In the relational model, relationships between relations or tables are created by using:

    • Options
    • A. composite keys.
    • B. determinants.
    • C. candidate keys.
    • D. foreign keys.
    • Discuss
    • 2. What does microprocessor speed depend on?
    • Discuss
    • 3. What does RSI stand for?
    • Discuss
    • 4. Which Stack is used in 8086?
    • Discuss
    • 5. What is object repository?
    • Discuss
    • 6. Which is the Stack used in 8085?
    • Discuss
    • 7. What does GUI stand for?
    • Discuss
    • 8. What is the main reason the OSI Model was created?
    • Discuss
    • 9. Ethernet uses which topology

    • Options
    • A. Star
    • B. Bus
    • C. Twisted pair
    • D. Both B & C
    • Discuss
    • 10. What are various scheduling queues?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment