C Program to Implement Wheel Sieve to Generate Prime Numbers

This is a C Program to find prime number between a given range using Wheel Seive method. Wheel factorization is a graphical method for manually performing a preliminary to the Sieve of Eratosthenes that separates prime numbers from composites. The algorithm goes this way, Start by writing the natural numbers around circles as shown below. … Read more

advertisement

C Program to Implement the Bin Packing Algorithm

This is a C Program to implement Bin packing algorithm. This is a sample program to illustrate the Bin-Packing algorithm using next fit heuristics. In the bin packing problem, objects of different volumes must be packed into a finite number of bins or containers each of volume V in a way that minimizes the number … Read more

advertisement

C Program to Implement Naor-Reingold Pseudo Random Function

This is a C Program to genrate random numbers using Naor-Reingold random function. Here is source code of the C Program to Implement Naor-Reingold Pseudo Random Function. The C program is successfully compiled and run on a Linux system. The program output is also shown below. #include <stdio.h>#include <math.h>#include <stdlib.h>#include <time.h> int main(int argc, char **argv) … Read more

advertisement

C Program to Implement Linear Congruential Method for Generating Pseudo Random Number

This is a C Program to generate random numbers using Linear Congruential Generator. The linear congruential generator is a very simple example of a random number generator. All linear congruential generators use this formula: r{n + 1} = a x rn + c mod m Where: r0 is a seed. r1, r2, r3, …, are … Read more

advertisement

C Program to Perform a 2D FFT Inplace Given a Complex 2D Array

This is a C Program to perform 2D FFT. A fast Fourier transform (FFT) is an algorithm to compute the discrete Fourier transform (DFT) and its inverse. Fourier analysis converts time (or space) to frequency and vice versa; an FFT rapidly computes such transformations by factorizing the DFT matrix into a product of sparse (mostly … Read more

advertisement

C Program to Perform Fermat Primality Test

This is a C Program to test whether a number is prime or not. The Fermat primality test is a probabilistic test to determine if a number is probable prime. Here is source code of the C Program to Perform Fermat Primality Test. The C program is successfully compiled and run on a Linux system. … Read more

advertisement

C Program to Compute Discrete Fourier Transform using Naive Approach

This is a C Program to perform Discrete Fourier Transform using Naive approach. The discrete Fourier transform (DFT) converts a finite list of equally spaced samples of a function into the list of coefficients of a finite combination of complex sinusoids, ordered by their frequencies, that has those same sample values. It can be said … Read more

advertisement

C Program to Compute Discrete Fourier Transform Coefficients

This is a C Program to compute the coefficients of the DFT (Discrete Fourier Transform) directly. The discrete Fourier transform (DFT) converts a finite list of equally spaced samples of a function into the list of coefficients of a finite combination of complex sinusoids, ordered by their frequencies, that has those same sample values. It … Read more

advertisement

C Program to Emulate N Dice Roller

This is a C Program to emulate N-dice roller. This can be done by generating random number between 1-6. Here is source code of the C Program to Emulate N Dice Roller. The C program is successfully compiled and run on a Linux system. The program output is also shown below. #include <stdio.h>#include <stdlib.h>#include <time.h> int … Read more

advertisement

C Program to Solve Knapsack Problem Using Dynamic Programming

This is a C Program to solve knapsack problem. The knapsack problem or rucksack problem is a problem in combinatorial optimization: Given a set of items, each with a mass and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.