#include<iostream>
using namespace std;
int main()
{
int a,d;
cout<<"Enter a integer to check it is prime or not :";
cin>>a;
d=2;
while(a%d!=0)
{
d++;
}
if(a==d)
{
cout<<"\n the given number id prime ";
}
else
cout<<"\n the given number is not a prime number ;"
return 0;
}
pramod_8 0 Newbie Poster
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
rproffitt commented: Some folk find it odd to use prior works. I think this makes us even. +10
AssertNull 1,094 Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.