Wednesday, April 22, 2020

File management in C


  • Program :

#include<stdio.h>
int main()
{
    FILE *f1;
    char c;
    printf("\n----------------FILE MANAGEMENT----------------");
    printf("\nData Input");
    f1=fopen("Input","w");
    while((c=getchar())!=EOF)
    putc(c,f1);
    fclose(f1);
    printf("\nData Output");
    f1=fopen("Input","r");
    while((c=getc(f1))!=EOF)
    printf("\n%c",c);
    fclose(f1);
}




  • Output :



No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...