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 / md.irfan(rourkela)

#include<iostream.h>
#include<conio.h>
main()
{
int n,i,f=1;
cout<<"enter any no to check prime";
cin>>n;
for(i=2;i<n;i++)
{
if(n%i==0)
k=2;
}
if(k==2)
cout<<"the no is not prime"<<endl;
else
cout<<"the no is prime";
}
getch();
}

Is This Answer Correct ?    145 Yes 91 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is malloc in c++?

1013


what is Loop function? What are different types of Loops?

1229


What is the difference between a "copy constructor" and an "assignment operator" in C++?

1074


What are the methods of exporting a function from a dll?

1223


Are php strings immutable?

1053


What is the full form of c++?

1344


What is do..while loops structure?

1145


how to connect with oracle 9i with server in socket program in c/c++

2343


Describe private, protected and public?

1076


How we can differentiate between a pre and post increment operators during overloading?

1100


What are the different types of polymorphism in c++?

1132


What is the best way to take screenshots of a window with c++ in windows?

1049


Explain the difference between realloc() and free() in c++?

1012


What is called array?

1081


Explain deep copy?

1052