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 / pramod k sharma

#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 ?    14 Yes 32 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can union be self referenced?

1069


Write about a nested class and mention its use?

1046


To which numbering system can the binary number 1101100100111100 be easily converted to?

1000


What is #include iostream?

1191


What are member functions used in c++?

1073


What is anonymous object in c++?

1035


Do you know what are pure virtual functions?

1105


How can an improvement in the quality of software be done by try/catch/throw?

1003


Differences between private, protected and public and give examples.

1001


Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened

1509


Define whitespace in C++.

1144


What is copy constructor? Can we make copy constructor private in c++?

1026


What is c++ virtual inheritance?

1073


What is c++ hiding?

1114


What is insertion sorting?

1063