#include<iostream.h> #include<conio.h> void main() { clrscr(); int n; cin>>n; for(i=2;i<=n/2;i++) { if(n%i==0) { cout<<"the no. is not prime"; break; } } if(i>n/2) { cout<<"no. is prime"; } getch(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)