This is a simple C program that checks whether a given number is a prime number or not. It accepts a number from the user and prints a clear message about its status.
- ✔ Checks if the input number is a prime
- ❗ Handles edge case: 1 is neither prime nor composite
- 📘 Uses basic loops and conditionals only
- 🖥 Beginner-friendly, no external libraries required
- Takes an integer input
n
- If
n == 1
, prints it's neither prime nor composite - Otherwise, checks divisibility from
2
ton-1
- If no divisor is found → prime, else → not prime
Enter any number: 13
13 is a prime number
Enter any number: 9
9 is not a prime number
Enter any number: 1
1 is neither a prime nor a composite number.
See included LICENSE file for more details.