C program to Convert the file contents in Upper-case & Write Contents in a Output file


C program to convert the file contents in Upper-case & Write Contents in a output file

Write a program to read a text file and convert the file contents in capital (Upper-case) and write the contents in a output file. Program to copy the contents of one file into another by changing case.

Explanation :

Open one file in the read mode another file in the write mode.

Now read file character by character. toupper() function will convert lower case letter to upper case.

After converting into upper case, we are writing character back to the file. Whenever we find End of file character then we terminate the process of reading the file and writing the file.