#include<stdio.h>
#include<conio.h> //header file declaring
void main()
{
int a,i;
clrscr();
printf("\n Enter the Number:"); //get value
scanf("%d",&a);
if(a%2==0) {
printf("\n Not prime number");
} else {
for(i=3; i<a; i=i+2) {
if(a%i==0) {
printf("\n Not a prime");
break;
}
}
printf("\n Prime number");
}
getch();
}
vinodhsml 0 Newbie Poster
D33wakar 36 Posting Whiz in Training
pseudorandom21 166 Practically a Posting Shark
cse.avinash -1 Junior Poster
Adak 419 Nearly a Posting Virtuoso
ashok1514 -4 Newbie Poster
vinodhsml 0 Newbie Poster
NP-complete 42 Junior Poster
Prateek nandan -4 Newbie Poster
reojavier 0 Newbie Poster
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.