Check weather no is prime or not

it is not showing any error but only 1 test case is passed so why what is wrong in my code
#include
#include
using namespace std;
int main() {
int n ;
cin>> n;
bool flag=0;
for(int i=2; i<sqrt(n); i++)
{
if(n%i==0){
cout<<“Not Prime”<<endl;
flag=1;
break;
}
}
if(flag=0){
cout<<“Prime”<<endl;
}

return 0;

}

mistake:

if(flag=0){
cout<<“Prime”<<endl;
}

correct one:

if(flag==0){
cout<<“Prime”<<endl;
}

Modified code :

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.

ThAnk you my doubt is clr now