# C Programming Code Examples

## C > Arrays and Matrices Code Examples

### C Programming - Second largest array element in C

UnOrdered Permutation Algorithm in C++ -
It initializes the value current level, permutes the remaining values to the 'higher levels'. As the Assigning Action of the values reaches to the "Highest Level", it prints the permutation

Randomized Primality Testings Algorithm -
Method that implements the basic primality test. If witness doesn't return 1, n is definitely composite. Do this by computing a^i (mod n) and looking for "non-trivial" square roots of 1

C++ Codings Find the Maximum Subarray -
Implement the 'naive method' to find the sub array having a maximum sum. The worst case time 'Complexity' of the algorithm is 'O(n*n)'. Take the input of the 'integer array'. Compare

C++ Program to Implement Insertion Sort -
Insertion sort algorithm sort data by inserting them one by one into the List. This algorithm is based on sorting playing cards by picking & inserting them one by one. Here we take data

C Program Codes write data in DMA Mode -
Motor on, command code, cylinder no. Sense Interrupt Command. Reading ST0 in data register. Initialization DMA Mode. Supplying Mode Byte. Supplying channel no. on port 10.

Function Chaining Calls Using This Pointer -
Example of using this 'pointer' is to return the "Reference of current object" so that you can chain "function calls", this way you can call all the functions for the current object in one go.

Program to Find number of Days in month -
Program code enter Month number between 1-12 and print number of days in month using If Else. Input month number from user. Store it in a variable say month and for each month

C Programming Codes Displaying a Table -
C Language code how to display a table in C programming language is more or less similar to that of counting. We use only one iteration and increment it with value of which table is