Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- int main()
- {
- int p, i = 2;
- cin >> p;
- while (i < p)
- {
- if (p%i != 0)
- {
- i += 1;
- }
- else
- {
- cout << "wartosc nie jest liczba pierwsza";
- _getch();
- break;
- }
- }
- if (i == p)
- {
- cout << "wartosc jest liczba pierwsza";
- _getch();
- }
- }
Add Comment
Please, Sign In to add comment