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

What is the keyword auto for?

1041


give me an example for testing a program showing the test path .show how the test is important and complex.

2942


daily Routine of father

1412


Define a pdb file.

1073


Write a Program for find and replace a character in a string.

1082


What's the order in which the local objects are destructed?

1266


What is a literal in c++?

1106


Difference between overloading vs. Overriding

1090


Explain the use of vtable.

1088


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create

2633


Is c++ a pure oop language?

1085


If dog is a friend of boy, is boy a friend of dog?

986


Does c++ cost money?

996


Do you know what are the new features that iso/ansi c++ has added to original c++ specifications?

1127


Can malloc be used in c++?

1082