# C Programming Code Examples

## C > Arrays and Matrices Code Examples

### Program to Calculate Addition of All Elements in Array

C Checking Armstrong Number of n digits -
Check Armstrong Number of n digits. In case of an Armstrong number of 3 digits, the sum of cubes of each digits is equal to the number itself. Example 407 = 4*4*4 + 0*0*0 + 7*7*7

C Program Code Performing Binary Search -
C program, Using Recursion, performs binary search. In this C program, an array of random number is generated. User is asked to enter a key. The array of random numbers are sorted

Code Finds Maximum Between 2 Numbers -
Finding maximum in general is comparison of two numbers. In C programming we compare two quantities using relational operator. Use either > or < operator to compare 2 numbers

C Perform Matrix Multiplication Recursion -
C program, 'using recursion', performs Matrix multiplication of 2 'matrices' and displays the result. We use 2 D array to represent a matrix & resulting matrix is stored in different matrix

Program to Create a Random Graph Using -
This algorithm randomly assigns a number of vertexes and edges of the graph. It connects vertexes randomly & generates cyclic, acyclic or disconnected undirected graphs. Generate

C++ Codes Check a Number is Palindrome -
C++ sample ask to enter a number to reverse it, then check whether reverse is equal to its "original or not", if "it is equal" then it will be palindrome else it will be not be palindrome:

Find ith Largest Number from a Given List -
It is an improvement in BST by adding 2 more key functions - 'rank()' and 'select()'. The time complexity of Order-Statistic tree generation is O(n+n*log(n)). Once the tree is constructed

Finds the Frequency of the Word in String -
Take any Sentence as input and store it in the array 'string[]'. If the input string has 't', 'h', 'e' and ' ' Consecutively, then store that values in the variables 't, h, e & space' respectively. Use