C Programs 55 Lessons

C Program to Find Maximum Element in Array

This program find maximum or largest element present in an array. It also prints the location or index at which maximum element occurs in array. Program: #include <stdio.h> int main() { int array[100], maximum, size, c, location = 1; printf("Enter […]

    C Program to Find Minimum Element in Array

    C program to find smallest element present in an array. It also prints the location or index at which minimum element occurs in array. Program: #include <stdio.h> int main() { int array[100], minimum, size, c, location = 1; printf("Enter the […]

      C Program to Reverse an Array

      This program reverses the array elements. For example if a is an array of integers with three elements such that a[0] = 1 a[1] = 2 a[2] = 3 Then on reversing the array will be a[0] = 3 a[1] […]

        C Program to Print Integer

        This C program is used to print given integer input by the user on the screen. scanf function is used to obtain input and printf function is used to print the number on the screen. Example: #include<stdio.h> int main() { […]

          C Program to Insertion Sort Using Array

          This C program will show you how to short numbers at the time of Insertion. This code implements insertion sort algorithm to arrange numbers of an array in ascending order. With a little modification it will arrange numbers in descending […]

            C Program to Delete an Element from an Array

            Deleting an element does not affect the size of array. It is also checked whether deletion is possible or not. For example if array is containing five elements and you want to delete element at position six which is not […]

              C Program to Merge Two Files

              This C program merges two files and stores their contents in another file. The files which are to be merged are opened in read mode and the file which contains content of both the files is opened in write mode. […]

                C Program to Swapping Two Numbers Using a Temporary Variable

                This C program is used to swapping two numbers, using a temporary variable. Example: #include<stdio.h> int main() { int x, y, temp; printf("Enter the value of x and y: "); scanf("%d %d", &x, &y); printf("Before swapping x=%d, y=%d ", x, […]

                  C Program to Reverse Number

                  This C program reverse the number entered by the user, and then prints the reversed number on the screen. For example if user enter 423 as input then 324 is printed as output. We use modulus(%) operator in program to […]

                    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 […]

                          Scroll Back to Top