this is my code , can u let me know why my code is not getting executed
Why my code is not getting perfectly executed
I am not able to see your code. Ensure that you have given correct ide for your code…
#include
using namespace std;
int main() {
int n;
int i;
cin>>n;
for (i=2;i<=n-1;i++){
if(n%i==0){
cout<<n<<“Not a Prime number”<<endl;
break;
}
}
if(i==n){
cout<<n<<“It is a Prime number”<<endl;
}
}
here is my code
I have edited your code… Try to submit now…
May i know what was the error in my code
You have to print the output in same format as given in your question…also I have tried a little optimised version in your code for large test cases…rest logic is fine. .
OK thank you for solving my query 