# C Programming Code Examples

## C > For Loops and While Loops Code Examples

### C program to convert Octal to Hexadecimal number system

C++ Program Three Dimensional 3D Array -
3D array contains three for loops. to initialize and "print three dimensional" array, you have to use three for loops. Third for loop forms 1D array, Second for loop forms 2D array and the

Find Sum of Opposite Diagonal Elements -
C program to read elements in a matrix and find the sum of minor diagonal elements. C program to calculate sum of minor diagonal elements. Input elements in matrix from user

Compute to difference between two dates -
C Programming code sample to compute difference between two dates. Enter first day, month, year. No. of days of first date from the Jan 1. Count for additional days due to...

C Program to Illustrate Pass by Reference -
C code to illustrate pass by reference. Pass the addresses of the variables as parameters to the function. In function definition receive the parameters through pointers. Print the...

Program to Generate All Pairs of Subsets -
The "time complexity" of this algorithm is O (n*2^n). This algorithm takes the input of 'n' data element and prints unique subset pairs whose union gives the set. It generates 0 to

Perform to a 2D FFT Inplace a Complex 2D -
A fast Fourier transform (FFT) is an algorithm to computing the discrete 'Fourier transform' and its inverse. Fourier analysis converts time (or space) to frequency and vice versa; an FFT

Find Lowest Common Ancestor in Binary -
This C++ program, using recursion, displays the "Lowest Common Ancestor" in a binary search tree. lowest common ancestor is one in which the lowest common parent node of

C++ Program to Implement Vector in STL -
C++ code to Implement Vector in STL. Insert element into the vector. Delete last element of the vector. "Size of the vector". Display by index. "Dislplay by iterator". Clear the vector