Menu

[solved]-Use C Count Number Lines File Perform Following Operation Read Console Input Create Filetx Q39078950

Use C ++

Count the number of lines in a file.

Perform the following operation

  • Read the console input and create a file.txt.
  • $ in the console input is considered as an end of content for afile.
  • Close the file after creation.
  • Print the count of total lines in a file.

Input

    Music is like a dream.
    Without music, life would be amistake
    I can chase you, and I can catch you, butthere is nothing I can do to make you mine
    Music gives a soul to the universe,
    wings to the mind,
    flight to the imagination and life toeverything.

$

Where

  • $ indicate an end of console input for a file.

Output:
6

Expert Answer


Answer to Use C ++ Count the number of lines in a file. Perform the following operation Read the console input and create a file.t… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *