Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write the program for prime numbers?

Answer Posted / d.sukumar

void main()
{
int i,k;int count=0;
int n;
printf("enter a no");
scanf("%d",&n);
for(i=2;i<=n;i++)
{
k=n%i;
if(k==0)
{
count++;
}
}
if(count==1)
printf("prime");
else
printf("not prime");
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ambagious result in C? explain with an example.

2630


Why is C language being considered a middle level language?

1126


Place the #include statement must be written in the program?

1036


Are pointers integers in c?

1073


What is conio h in c?

1047


Difference between strcpy() and memcpy() function?

1141


What are the similarities between c and c++?

1068


What is #line?

1051


what is a function method?give example?

2363


What is adt in c programming?

1162


What is the maximum length of an identifier?

1184


Apart from dennis ritchie who the other person who contributed in design of c language.

1395


What are the rules for the identifier?

1158


Why should I use standard library functions instead of writing my own?

1269


Why static is used in c?

1091