C program to print all the prime numbers between given range

Posted by Editorial Staff | Updated on

Thos c program to print all the prime numbers between given range Below is the algorithm of this program:

Algorithm to find prime numbers

  1. Take the range of numbers between which you have to find the prime numbers as input.
  2. Check for prime numbers only on the odd numbers between the range.
  3. Also check if the odd numbers are divisible by any of the natural numbers starting from 2.
  4. Print the prime numbers and its count.

C program to find the prime numbers between a given interval

Program output

Here is same the program using Java programming language.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers