Log In

C Visual Studio Files

1. Create a complete programthat:

a.  prompts a user to enter the name of anexisting file. 

b. If the file does not existand or cannot be opened, the program should display an error message andquit. 

c. If the file exists and canbe opened, prompt the user for a new file-name.

d. If the new file name alreadyexists, print a message telling the user that the file already exists and askthe user whether they want to APPEND

 i.  if the user enters ‘N’ for “NO”, print a message “Operationcanceled by user” and quit

 ii.  otherwise, open the file for APPEND and copy all of the contentsfrom the original file

If the file doesn’t already exist, create a newfile with the name supplied by the user and copy the contents of the originalfile into it

× How can I help?