Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to perform file read and write operations

Posted By: Barrett Schmidt     Category: C Programming     Views: 19334

Write a program to perform file read and write operations.

Code for Program to perform file read and write operations in C Programming

#include<stdio.h>
#include<conio.h>

void main()
{
    FILE *f1;
    char c;
    clrscr();

    printf("Data Input\n\n");
    f1 = fopen("INPUT","w");

    while((c=getchar()) != EOF)
        putc(c,f1);

    fclose(f1);

    printf("\nData Output\n\n");
    f1 = fopen("INPUT","r");

    while((c=getc(f1)) != EOF)
        printf("%c",c);
    fclose(f1);
    getch();
}
  
Share: 


Didn't find what you were looking for? Find more on Program to perform file read and write operations Or get search suggestion and latest updates.

Barrett Schmidt
Barrett Schmidt author of Program to perform file read and write operations is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!