# C Programming Code Examples

## C > If Else and Switch Case Code Examples

### GCD Using while loop and if...else Statement

C Codes Multiply 2 Numbers use Function -
Create a user defined function product() that multiplies the numbers that we are passing to it during function call. This c function returns the product of these numbers. To understand

Implementing Hash Table Double Hashing -
Genereate first "Hash" and genereate second hash. Initialize table and "Find" element from the table. Function to insert element into the table. Function to rehash the table. Retrieve

C Segregate 0s on left side 1s on right side -
C Program to Segregate 0s on left side and 1s on right side of the Array (Traverse Array only once). Function to segregate all 0s on left and all 1s on right. Increment left index while we

C++ Finds Maximum Element in an Arrays -
Construct "Binary Search" tree for "unsorted" data array. For the 'Maximum element' move the pointer to the rightmost child node. This value will be the minimum value among data.

QuickSort For Files in The C Programming -
First, create a file to sort, write unsorted data to disk and now, sort the file. Sorting disk file. A Quicksort for files. First read in record i and j and then write them back in opposite slots.

C Sum of the Main and Opposite Diagonal -
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

Take decimal number as input & converts -
C Program take a decimal number as input. Divide the input number by 8 and obtain its remainder and quotient. Store the remainder in the array. Repeat the step 2 with quotient

Singly Linked list Program Using functions -
In C++, under the simplest form, each node is composed of data and a reference ('a link') to the next node in the sequence. This structure allows for efficient insertion or removal of the