I have perused a lot of code on this topic, but most of them produce the numbers that are prime all the way up to the input number. However, I need code which only checks w
//simple function to determine if a number is a prime number
//to state if it is a prime number
#include
using namespace std;
int isPrime(int x); //functioned defined after int main()
int main()
{
int y;
cout<<"enter value"<>y;
isPrime(y);
return 0;
} //end of main function
//-------------function
int isPrime(int x)
{
int counter =0;
cout<<"factors of "<2)
{
cout<<"value is not a prime number"<<"\n\n";
}
if(counter<=2)
{
cout<<"value is a prime number"<