A simple C program to check if a number is prime and to generate prime numbers within a range or up to a given limit. Useful as an educational example of control flow, loops, functions, and basic number theory in C.
- Check if a number is prime
- Generate all prime numbers up to a given limit
- Find all prime numbers within a custom range
- Simple terminal interface with user prompts
To compile the program, use a C compiler like gcc:
gcc -o primeGenerator primeGenerator.cOnce compiled, run the program from the terminal:
./primeGeneratorYou will be prompted to choose one of the following options:
- Find prime numbers in a custom range
- Generate all prime numbers up to a given number
- Exit the program
Pull requests are welcome! If you have ideas for improvements (e.g. better UI, saving results to file, or performance optimizations), feel free to open an issue or fork the project.
This project is licensed under the MIT Licence.