C Programming Introduction Exercise

Use this summary sheet as a guide:

1) Create a program that creates a file named firstout.txt and write something to it

Need to know:

2) Change #1 to use a filename given as a parameter and a word given as a parameter instead.

Need to know:

3) Change #1 to convert the first character of the string to uppercase before writing it.

Need to know:

4) Create a program to read one line from the screen and append to an existing file file4.out

Need to know:

5) Change the program in #4 to read 10 characters from a file named file4.in instead of from the screen

Need to know:

6) Change the program in #5 (originally #4) to write the first 10 characters from file4.in to replace the first 10 characters in an existing file

Need to know:

7) Change the program in #6 (originally #4) to write starting at the 20th character of file4.out. Write the line twice.

Need to know:

8) Create a new program that takes a parameter as the directory name (like #2) and prints all the files in the directory

Need to know:

9) Optional: Create a new program that takes a parameter as the filename (like #2), opens the file and then reports an error if the filename is not a regular file. If the file is a directory, it will give an error. Otherwise, print the size of the file.

Need to know: