Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Prime or Not
- // TomvG
- // 8-11-2017
- #include <iostream>
- using namespace std;
- int main()
- {
- int number;
- int d = 2;
- cout << "Enter a number: " << endl;
- cin >> number;
- while (number && d != 0)
- {
- ++d;
- if (d < number)
- {
- cout << number << " is not a prime number" << endl;
- }
- }
- cout << number << " is a prime number" << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment