C program to Copy the contents of one file into another using fputc


Program to copy the contents of one file into another using fgetc and fputc function

Output :

Explanation of Program :

We have to files with us , we are opening one file in read mode and another file in write mode.

and

It is better practice to check whether file is opened successfully or not using NULL check.

If everything goes right then we are reading file character by character and writing on file character by character.

End of File is specified by EOF character, thus if we get EOF character then process of writing on the file will be terminated.