C Programs

55 Lessons

C Program to Copy Files

This C program is used to copy a file. Firstly you will specify the file to copy and then you will enter the name of target file, You will have to mention the extension of file also. We will open […]

    C Program to Addition of Two Numbers using Pointer

    This program performs addition of two numbers using pointers. In this program I have used two integer variables x, y and two pointer variables p and q. Firstly I have assign the addresses of x and y to p and […]

      C Program to Delete a File

      This C program deletes a file which is entered by the user, the file to be deleted should be present in the directory in which the executable file of this program is present. Extension of the file should also be […]

        C Program to Find the Number of Lines in a Text File

        Number of lines in a file can be determined by counting the number of new line characters present. #include <stdio.h> int main() / Ask for a filename and count number of lines in the file/ { //a pointer to a […]

          C Program to Replace a Specific Line in a Text File

          This C program is used to replace a specific line in a text file. #include <stdio.h> int main(void) { FILE fp1, fp2; //'filename'is a 40 character string to store filename char filename[40]; char c; int del_line, temp = 1; //asks […]

            Scroll Back to Top