ive created a program that'll out the output prime numbers from the users input but i dont know how to tell the user whether the number is prime. pls help :'(
cout << "Enter a number ----> : " << endl;
cin >> num;
int i, j, primeNum;
for(i = 2; i < 102; i++)
{
primeNum = 0;
// Check whether i is prime or not
for(j = 2; j < num; j++)
{
if(i % j == 0)
{
primeNum= 1;
break;
}
}
if(primeNum == 0)
{
cout << i << " ";
}
}