# C Programming Code Examples

## C > Mathematics Code Examples

### C Program to Find the GCD and LCM of Two Integers

C++ Program Finds HCF of Two Numbers -
To find the HCF ('Highest Common Factor') or GCD (Greatest Common Divisor) of 2 or more numbers, make prime factors of the numbers and choose the common prime factors. Then

Program to Display Alphabets using ASCII -
Printing alphabets in C Programming, is little trick. If you are good at basic data types and literals then this is easy for you. Internally C represent every character using ASCII Code.

C Language Program Print Reverse Array -
Print an array in reverse order, we shall know the length of the array in advance. We can start an iteration from length value of array to zero and in each iteration we can print...

Generate All Subsets of a Given Set in the -
Print all combination of a given length from the given array. Return if the currLen is more than the "required length". If currLen is equal to required length then "Print the sequence".

Find the Largest Two Numbers in an Array -
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...

C Check if the Matrix is an Identity Matrix -
C code checks a given Matrix is an Identity Matrix. Identity matrix is a square matrix with 1's along the diagonal from upper left to lower right and 0's in all other positions. If it

Implement Find all Cross Edges in a Graph -
This C++ program, "using recursion", displays the number of cross edges in a graph. A cross edge is one in which a node points to another node which has already been fully visited. Int

Count total number of notes in an amount -
C program input amount and print minimum number of notes (Rs. 500, 100, 50, 20, 10, 5, 2, 1) required for the amount. There any many optimal algorithms to solve given problem.