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 / pavankumar

void main()
{
int i=2;
int count=0;
int n;
printf("enter a no");
scanf("%d",&n);
for(i=2;i<n/2;i++)
{
if(n%i==0)
{
count++;
}
if(count>1)
{
prinf("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

WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2402


to find the closest pair

2288


Why do we use null pointer?

997


What is this pointer in c plus plus?

1026


Why can arithmetic operations not be performed on void pointers?

982


Is it better to use malloc() or calloc()?

1065


What does %c do in c?

939


When should a type cast not be used?

1005


What is the difference between single charater constant and string constant?

1030


Why c is called top down?

1094


Why c is a mother language?

964


Why c language is called c?

950


Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?

1047


What is exit() function?

965


How can I prevent another program from modifying part of a file that I am modifying?

1010