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

Can variables be declared anywhere in c?

1034


List some of the dynamic data structures in C?

1189


Explain what header files do I need in order to define the standard library functions I use?

1114


What are called c variables?

1010


Is c is a high level language?

1124


Differentiate call by value and call by reference?

915


What is the difference between array and pointer in c?

1087


What is the acronym for ansi?

997


Why is c fast?

1007


Can you explain the four storage classes in C?

1067


Is stack a keyword in c?

1037


How can you return multiple values from a function?

1050


What are the 5 elements of structure?

1038


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

1102


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?

1045