Question: 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

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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!