 C++ Programming Code Examples

C++ > Mathematics Code Examples

C++ Program to Implement Park-Miller Random Number Generation Algorithm

C Convert Binary to Octal Number System - In C program user is asked to enter the binary number and the program then converts that binary number to the octal number by calling a user defined function. To understand this...

Swaps Array Elements and Reverse Arrays - Program declare an integer array of size five, initialize it using for loop. Pass size and array name to function. Function uses for loop and "swap array elements" with in it. A for loop is

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

C Coding Checks the Character is Alphabet - How to check whether a character is alphabet or not in C programming. Every printable and nonprintable symbol is treated as a character and has an ASCII value. ASCII value is unique

C++ Programs Finds kth Smallest Element - "Partitioning the array" on the basis of values at high as pivot value. Swapping value at high and at the index obtained. Partitioning array using last element as a pivot. And recursively

Print Combination of 2 Words of 2 Strings - Print combination of two words of two given strings without any repetition. Incrementing the count if the characters of the main string match with the characters of the given word.

Read Two Integers and Swap their Values - C language program coding to take the two integers as input and store it in the variables m & n respectively. Call function swap. Pass addresses of variables to the function swap.

C++ Generating All Subsets of a Given Set - Program print all the possible combination of each length from the given array in gray code order. The 'time complexity' of this algorithm is 'O(n*(2^n))'. This algorithm takes the input