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 / shubhanshu pandey

main()
{
int a,c=0,i,n;
printf("enter the number to be checked");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
a=n%i;
if(a=0)
{
c=c+1;
}
}
if (c=2)
{ printf("the given number is prime"); }
else
printf("the given number is not prime");
}

Is This Answer Correct ?    7 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In c programming language, how many parameters can be passed to a function ?

1126


What functions are used for dynamic memory allocation in c language?

1161


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

1152


What is 'bus error'?

1163


Difference between strcpy() and memcpy() function?

1162


Explain what are reserved words?

1116


What is meant by int main ()?

1218


What is d'n in c?

1129


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2878


Which is an example of a structural homology?

1333


Explain union. What are its advantages?

1089


Why does everyone say not to use scanf? What should I use instead?

1430


How would you rename a function in C?

1056


What is header file definition?

1095


Explain what is the general form of a c program?

1106