# Check Prime Number C Program

## C Program To Check Prime Number

Learn How To Check Prime Number in C Programming Language. It is important that we should know How A For Loop Works before getting further with this C Program.

#### What is a Prime Number?

A Prime Number is a Natural Number Greater than 1 and it should have No Positive Divisors other than 1 and the Number itself. A Natural Number greater than 1 but not a Prime Integer is known as a Composite Number.

#### Example

2, 3, 5, 7 ,11

These numbers are evenly divided by 1 and the number itself.

Must Read: C Program To Find Prime Numbers using Sieve of Eratosthenes Algorithm

#### Method 2: C Program To Check Prime Numbers using While Loop

Also Read: Convert Number To Words in C Programming

#### Output

Alternatively, you can also use this Condition  in the Loop.

for(count=2;count<=num/2;count++)

The above Condition count<=num/2 is an efficient Algorithm to Check Prime Integers and helps to reduce the Number of Comparisons and thereby efficient time complexity.

#### Method 3: Sieve Method To Find Prime Numbers in C Programming

If you have any compilation errors or doubts in this C Program To Check Prime Numbers, let us know about in the Comment Section below.

#### Tushar Soni

I am Tushar Soni, Co - Founder of CodingAlpha. I am a computer science student from India and passionate about Web Development and Programming. Connect with me on Facebook | LinkedIn | Google Plus

### 4 thoughts on “Check Prime Number C Program”

• August 3, 2016 at 1:54 pm

What is this sieve method for finding prime numbers about? Its quite confusing.

• September 11, 2016 at 2:23 pm

This is really good. So many methods to print Prime Numbers. Thanks.