C program to find number of lines in a file
In this program, we are going to learn how to find total number of lines available in a text file using C program?
This program will open a file and read file’s content character by character and finally return the total number lines in the file. To count the number of lines we will check the available Newline (\n) characters.
Hello friends, how are you?
This is a sample file to get line numbers from the file.