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 / venkat reddy

#include<stdio.h>
main()
{
int i,n,count=0;
printf("enter a no.");
scanf("%d",&n);
for(i=2;i<n;i++)

{
if(n%i==0)
{
count++;
}
}
if(count>1)
{
printf("not prime no.");

}
else
printf("prime");
}

Is This Answer Correct ?    344 Yes 155 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are derived data types in c?

1085


What is the size of array float a(10)?

1140


Why do we use return in c?

994


Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

1063


What is the difference between int main and void main?

1045


What is a program?

1254


Explain a pre-processor and its advantages.

1128


What is data structure in c and its types?

1069


program to convert a integer to string in c language'

2453


How can I send mail from within a c program?

1026


How can you avoid including a header more than once?

983


what does static variable mean?

1100


#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

1951


Why is struct padding needed?

1083


What is the use of c language in real life?

1023