Posts

Showing posts with the label prime check function

Prime Number Function (C++)

Image
/* And now i'll share c++ functions : - a function to check wether a number is a prime or not - a function to print prime numbers in a certain range - a main function as usually c++ do */ int primecheck(int n) {                 int i;                 for (i=2; i<n; i++)                 {                                 if (n % i == 0)                                          ...