C program to delete the File.

Posted by Mangesh on March 31, 2018

/* C program to delete the file. */

Description :

Following code is written in c languages to delete a already existing file. If the file does not exists it will simply display the message "Unable to delete the file...".

Program :

#include<stdio.h> 
int main()
{
   if (remove("filename.txt") == 0)
      printf("Deleted successfully....");
   else
      printf("Unable to delete the file..."); 
   return 0;
}


Output :

c program for delete file Executed and Tested in Turbo C 3.2

Written with from Mangesh.

Related Post
1 C program to read data from file.
2 C program to write data into file.
3 C program to delete the File.
Latest Post
1 shubhanshu
2 test
3 C program for Breadth First Search.
4 C program for Depth First Search(DFS).
5 C for circular queue using linked list.