Sunday 19 December 2010

Algorithm for read the contents of a given file and displays on the screen

Algorithm:


1. Start

2. Enter the name of the file to read

3. Open the given file in read mode using fopen()

4. If we get a null pointer the file does not exist, we can exit

5. If the file opens without any error

6. Read the contents of the file character wise

7. Print each character as you read

8. Once you reach the end of file

9. Close the file using fclose()

10. stop

No comments:

Post a Comment