This is a c program to list all prime numbers less than a given number. Within a loop it checks each number less than the given number, whether it is prime or not.
Search This Blog
Showing posts with label find prime number. Show all posts
Showing posts with label find prime number. Show all posts
Program to Check Whether a Number is Prime or Not
This is a c program to check whether a given number is prime or not. To check whether a number 'n' is prime or not, it is enough to check whether it is divisible by any number less than or equal to square root of n. If there is any number i less than or equal to square root of n which divides n completely, then it is not prime. Otherwise it is prime.
Subscribe to:
Posts (Atom)