A prime number is one that can only be divided evenly by itself and one. For instance, the number 5 is prime because it can only be divided evenly by 1 and 5. However, the number 6 is not prime because it can be divided evenly by 2 and 3, 18.
Here we have programming for this:
- #include iostream> with the namespace std;
- isPrime (bool int num); int main () int num=0;
- "Enter a number and I'll tell you if it's prime: "; cin >> num;
- If (isPrime(num)==true), then cout num " is prime."; otherwise, cout num " is NOT prime."
- return zero;
- isPrime bool (int input)
- if(input1) returns false; otherwise, if (input== 1||input==2 ||input==3)
- return false;
- else
- for(i=2 int; iinput; i++)
- if(input%i==0) return false; return true;
Read more about prime number:
https://brainly.com/question/145452
#SPJ4