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

What is the difference between set and map in c++?

1099


How would you differentiate between a pre and post increment operators while overloading?

1090


What is #include iomanip?

961


What data encapsulation is in c++?

1063


what is oops and list its features in c++?

1003


What is object oriented programming (oop)?

1073


What is a sequence in c++?

962


When can I use a forward declaration?

1039


Can we distribute function templates and class templates in object libraries?

1030


Define what is constructor?

1012


Write a program to find the Fibonacci series recursively.

1032


What new()is different from malloc()?

1060


Why do we use using namespace std in c++?

1032


What are shallow and deep copies?

1078


What are static member functions?

1054