A simple C++ program that prints prime numbers — written by a beginner for beginners.
This project helps anyone learning C++ to see how prime number logic works with functions and looping. 🚀
This program:
- Takes a number as input
- Checks each number from 2 up to that number
- Prints all the prime numbers found
Prime numbers are numbers greater than 1 with no divisors other than 1 and themselves.
- Easy to understand C++ code
- Beginner-friendly structure
- Demonstrates basic functions and loops
- Works on any standard C++ compiler
To use this project, first clone the repo:
git clone https://github.com/arnabp-x64/Prime_num_printer.gitThen compile the code (example using g++):
g++ Primenumprinter.cpp -o prime_printerRun the compiled program
./prime_printerThen enter a number when prompted — the program will print if the number is prime or not.
| File | Purpose |
|---|---|
Primenumprinter.cpp |
Main program logic |
Functions.cpp |
Helper functions |
Primenumprinter.exe |
Executable file |
LICENSE |
Project license |
If you want to improve this project:
- Fork the repository
- Make your changes
- Create a pull request
All helpful improvements are welcome! ✨
Have suggestions or want help understanding the code? Open an issue and ask!
Or, Email me at Gmail