This program asks user to replace the occurrence of M by N. user declare variables and some method for replacement of occurrences. Like user ask to put file name here if condition will come in use for checking out the file exist or not if not the message will be “file can’t be open” else the while condition will use in for passing to “EOF”. If the condition match if(ch==’M’||ch==’m’) then the process will use method to replace the letter with N from M. display result on the screen at last instance.
This is C program that ask user to replace the Letter M by N.
- Declare the variables.
- Using control statements.
- Display result on the screen.
Here is C source code to replace the Letter M by N. The output of this program shown below.
printf("Enter file name=");
printf("File can't be opened");