Check Prime Number

in Hindi - Check Prime Number



not yet

Source Code :

RUN#include<iostream.h>
#include <conio.h>

int main()
{
int num,i,count=0;
cout<<"Enter a number: ";
cin>>num;

for(i=2;i<=num/2;i++){
if(num%i==0){
count++;
break;
}
}
if(count==0 && num!= 1){
cout<<num<<" is a prime number";
}
else{
cout<<num<<" is not a prime number";
}
return 0;
}