Vivekananda College of Engineering and Technology

Department of Electronics & Communication Engineering

Back to Experiments
Experiment 3
C Programming Lab

Aim

To check whether a given number is prime or not.

Algorithm

1. Read an integer n.
2. If n <= 1, it is not prime.
3. Check divisibility from 2 to n/2.
4. If divisible, not prime; else prime.

Use or Edit the given C template

Output

Output will appear here after compilation.
C Programming Virtual Lab - Experiment 3