Deleting a file in C || File handling || C programming
In this program, we are going to Delete a file with the help of C Programming Language.

 

#include <stdio.h>
void main()
{
    int status;
    char fname[20];
    printf(" Enter the name of the file you want to delete : ");
    scanf("%s", fname);
    status = remove(fname);
    if (status == 0)
    {
        printf("The file is deleted\n", fname);
    }
    else
    {
        printf("The file wasn't deleted succesfully ", fname);
    }
}

#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post