Question: C PROGRAM Write a program, changename.c, which takes a filename as input and produces a filename with a different extension as output. Most filenames consist

C PROGRAM Write a program, changename.c, which takes a filename as input and produces a filename with a different extension as output. Most filenames consist of two parts, the basename (everything to the left of the last . character), and the extension (everything to the right of the last . character). Often, we wish to name our output files something similar to our input files, and changing the extension is a convenient way to do this. For example, if the input file is called "myprog.in", then an appropriate output file name would be "myprog.out". Write your program to first read a string (with no spaces in it) from the keyboard. This is the input filename (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 file having the output filename. The output file 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!