# C Programming Code Examples

## C > Arrays and Matrices Code Examples

### C program to add two matrices

Test Using DFS Whether a Directed Graph -
This C++ Program checks whether a directed graph is weakly connected or not. We can do "DFS" V times starting from every vertex. If any DFS, doesn't visit all vertices, then graph

Program Finds Prime Factors of a Number -
Factors of a number that are prime numbers are called as "Prime Factors" of that number. For example: 2 and 5 are the prime factors of 10. Logic to check prime factors of a number.

Program Implement Doubly Ended Queue -
Inserting element into the "deque". Deleting element from the deque. "Insert" element in "doubly ended queue". Enter the value to be inserted. Element inserted into empty deque.

Code Get Highest Order Set Bit of Number -
Highest position of a set bit from left to right in a number is said to be highest order set bit of that number. Highest order set bit of any negative integers is 31. Since, highest order...

C Language Codes to All Display Functions -
Get current Display Mode. Character with chosen attribute. Scroll the window up. Scroll the window down. Read the character & it's attribute. Positioning the Cursor. Selecting...

Code to Implement Sense Drive Command -
Put on the motor. Address of digital control port. Check whether the FDC is ready. Read the status of MSR. Check whether FDC is ready. Beginning of command phase. Input

C++ Code Add Two Matrix with 2D Arrays -
2 const variables row & col are used to define size. If we do not make both const then error found because without "const reserve word" they are behaving as variable. Before placing

Transitive Closure by Warshall's algorithm -
Finding the transitive closure using Warshall's Algorithm. The Transitive Closure of a binary relation R on a set X is the 'transitive relation' R+ on set X such that R+ contains R and R+ is