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 prime no program in c++?

Answer Posted / darren chang

bool checkPrime(int input)
{
for(int i=2; i<(input/2); i++)
{
if((input%i)==0)
{
return false;
}
}
return true;
}

Is This Answer Correct ?    14 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can I have a reference as a data member of a class? If yes, then how do I initialise it?

1158


What does the linker do?

982


What is operators in c++?

954


What is class syntax c++?

1085


Can we use clrscr in c++?

1021


Explain the use of vtable.

1026


Name the implicit member functions of a class.

1031


Is empty stack c++?

937


What is c++ good for?

1001


Write a code/algo to find the frequency of each element in an array?

1048


What is isdigit c++?

1059


Give an example of run-time polymorphism/virtual functions.

946


What are the types of container classes?

1084


What is the difference between the functions memmove() and memcpy()?

1075


Can java be faster than c++?

1106