write a c program to delete n characters from a particular p
write a c program to delete n characters from a particular position of a text file using functions and in c programming
Solution
#include <stdio.h>
int main()
{
FILE *fp1, *fp2;
//consider 40 character string to store filename
char filename[40];
char c;
int del_line, temp = 1;
//asks user for file name
printf(\"Enter file name: \");
//receives file name from user and stores in \'filename\'
scanf(\"%s\", filename);
//open file in read mode
fp1 = fopen(filename, \"r\");
c = getc(fp1);
//until the last character of file is obtained
while (c != EOF)
{
printf(\"%c\", c); //print current character and read next character
c = getc(fp1);
}
}

