[crayon-60fba0f79ac93721211473/] Output : [crayon-60fba0f79ac9e778872880/] Explanation :
We are reading one file character by character and same character is written in the other file which is opened in writing mode.
Read the single file character by character and change the case of character to uppercase and write the character to the file opened in write mode.
Compare two files in a C Programming Program : C Program to Compare two text/data files in C Programming Check whether two files are identical or not. [crayon-60fba0f79c5ba257817994/] Explanation : Firstly Declare two file pointers for two files. Open two files in read mode. Now Inside while loop read both files character by character. Check both characters whether they are equal or not. If inside if statement ch1 = EOF and ch2=EOF then both files are said to be equal otherwise both files are non identicle.
Program : Copy Text From One File to Other File [crayon-60fba0f79c96c552742597/] Explanation : To copy a text from one file to another we have to follow following Steps : Step 1 : Open Source File in Read Mode [crayon-60fba0f79c976644103540/] Step 2 : Open Target File in Write Mode [crayon-60fba0f79c979744934704/] Step 3 : Read Source File Character by Character [crayon-60fba0f79c97c896755566/] "fgetc" will read character from source file. Check whether character is "End Character of File" or not , if yes then Terminate Loop "putc" will write Single Character on File Pointed [...]
Program : [crayon-60fba0f79d088068948102/] Output : [crayon-60fba0f79d08f834580252/] Explanation : [crayon-60fba0f79d092221498139/] __FILE__ is Standard Predefined Macros in C Programming. This macro will expand to the name of current file path. Suppose we have saved this source code at path - [crayon-60fba0f79d095900462804/] then [crayon-60fba0f79d097461327571/] will be expanded as - [crayon-60fba0f79d09a221185963/]