Exercise - File Handling

  1. WAP to count and display characters from a file.

    Solution: C

  2. WAP to count number of characters, words, lines and length of a file.
  3. WAP to count number of vowels from a file.
  4. WAP to input file name from user and display its contents
  5. WAP to copy contents of one file into another file.

    Solution: C

  6. WAP to copy contents of one file into another file, filename is entered by user.

    Solution: C

  7. WAP to merge contents of two files into another file.

    Solution: C

  8. WAP to delete line from a file.

    Solution: C

  9. WAP to replace a specific line with another text in a file.

    Solution: C

  10. Write a menu based program that shows the working of a library. The menu options are:
    1. Add Book information
    2. Display all Books
    3. Search Book by Title
    4. Search Book by Author
    5. Count all Books in library
    6. Update Book Record
    7. Delete Book
    0. Exit
    Create a structure called Library to hold Book code, title, author name and store in a file.

    Solution: C

Advertisement