Write a program, changename.c, which takes a lename as input and produces a lename with a dierent extension as output. Most lenames consist of two parts, the basename (everything to the left of the last ‘.’ char- acter), and the extension (everything to the right of the last ‘.’ character). Often, we wish to name our output les something similar to our input les, and changing the extension is a convenient way to do this. For example, if the input le is called “myprog.in”, then an appropriate output le name would be “myprog.out”. Write your program to rst read a string (with no spaces in it) from the keyboard. This is the input lename (although we are not actually going to be reading from it). The program then creates an output string which is a a copy of the input string except that everything after the last ‘.’ character is replaced with the extension “out”. The input string and the output string are written to a le having the output lename. The output le should look like: input name is my.program.in output name is my.program.out
Expert Answer
/*Source code of the above problem is given below*/
#include<stdio.h>
#include <stdlib.h>
int main()
{
/*declaring necessary variables*/
char iFileName[500];
char oFileName[500];
char sentence[1000];
FILE *fptr;
char *temp;
int index;
sentence[0]=’