Why its showing as wrong answer?

#include
using namespace std;

int main()
{
cout << “Enter a number:\n”;

int num = 0, prime = 1;

cin >> num;

for (int i = 2; i <= (num/2); i++)
{
if ( num % i == 0)
{
prime = 0;
break;
}

  else
  {
      prime  = 1;

  }

}

if (prime == 0)
{
cout << num <<" is not a prime number!\n";
}
else
{
cout << num << " is a prime number!\n";
}

return 0;

}

hi @discobot, corrected

Hi! To find out what I can do, say @discobot display help.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

Hi… The code I used also works right? We can get the same answer. But why its shown as wrong code?

hi @discobot ive commented out your mistakes
u need to print correct msgs
and no need to print extra msgs like enter no this that