Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


C Programming Code Examples

C > Arrays and Matrices Code Examples


Program code to delete an element from an array at specified position. How to remove an element from array at given position. Array is a linear data structure. It provides an index...

C Program deletes specified integer from an array. It accepts an array and the number to delete. Enter how many elements. Get Input array elements are. Enter the element to be

C Program determines the given matrix is a sparse matrix. Sparse matrix is a matrix with the majority of its elements equal to zero. Accept matrix and checks whether the given


C Program code finds the sum of the main & opposite diagonal elements of a MxN Matrix. The program accepts an MxN matrix. Then adds main diagonal of matrix as well as the

Before accepting the Elements Check if no of rows and columns of both matrices is equal. Accept the Elements in Matrix 1. Accept the Elements in Matrix 2. Subtraction of two...

Code find 2 Elements in the Array such that Difference between them is Largest. This C Program checks 2 elements in the array such that difference between them is largest and



C program to read elements in a matrix and find determinant of the given matrix. The Determinant of a matrix is a special number that can be calculated from the elements of




Function to find the largest element in the array. In the following program we are initializing a variable (maxelement) with the first element of given array and then we are

Read elements in a matrix and check whether the matrix is a lower triangular matrix or not. To find whether a matrix is lower triangular or not we need to check if all elements above...

Code to enter elements in an array from user and find maximum and minimum elements in array. C program to find biggest and smallest elements in an array. Input element in array...

C program to read elements in an array and find its reverse. C Program to print reverse of an array. There are various ways to reverse an array. The basic three algorithms to reverse a

Code to find the largest and second largest element in an array. Step by step descriptive logic to find second largest element in array. Find second largest element of an array in C


Write a C program to read elements in an array and find the sum of all elements of the array. C program to find sum of elements of the array. How to add elements of an array

C program to read elements in a matrix and find the sum of elements of each row and columns of matrix. C program to calculate sum of rows and columns of matrix. Input...

C program to read elements in a matrix and find sum of lower triangular matrix. How to find sum of lower triangular matrix in C. Find sum of lower triangular matrix, we need to
Read elements in a matrix and find the sum of main diagonal (major diagonal) elements of matrix. Find sum of all elements of main diagonal of a matrix. Input elements in the
Sum of upper triangular matrix is denoted with below image. In below image we need to find sum of matrix elements inside the red triangle. C program to read elements in a...
C Program to find the biggest number in an array of numbers using recursion. Program prints the largest number in an unsorted array of elements using recursion. Array is...
Program code finds frequency of odd & even numbers in the given matrix. The program first accepts the matrix. Then finds the odd and even numbers in a matrix. Then finds the
C Program code calculates the largest of two numbers in a given Array. First it accepts an array, then compares the elements and finds which is the largest two element in a given...
Formula that we are using to find the number of elements is common for all types of array. In this example, we have an array of double data type, however you can use the same...
Will hold XOR of two odd occurring elements. Xor will basically be xor of two odd occurring elements. Get one set rightmost bit in the xor2. Now divide elements in two sets. XOR
C Program finds second largest & smallest elements in an array. The program sorts the array in an descending order. Then it finds the second largest and smallest element in
C Program finds the sum of each row & each column of a MxN matrix. The c program code accepts an MxN matrix. Then adds each row of the matrix and also adds each column of...
C program to read elements in a matrix and find the sum of minor diagonal elements. C program to calculate sum of minor diagonal elements. Input elements in matrix from user
C Program to Find the Summation of Node values at Row or Level. Create a new node with the data from the user. Check for root node and then create it. Searching for the...
C Program find the trace & normal of a given matrix. Trace of the matrix is the sum of the elements of the main diagonal i.e diagonal from the upper left to the lower right of a...
Initialize the array named array[] with the random values. Call function minabsvaluepair and pass array and its size as parameters. In the function definition receive parameters...

Page 1 Page 2 Page 3 Page 4