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
What kind of jobs can I get with c++?
Using a smart pointer can we iterate through a container?
What is a unnitialised pointer?
What is malloc in c++?
Explain the difference between overloading and overriding?
What is the purpose of template?
Does c++ have a hash table?
If I is an integer variable, which is faster ++i or i++?
When do you call copy constructors?
Can non graphic characters be used and processed in C++?
Differentiate between the message and method in c++?
Describe the advantages of operator overloading?
Do inline functions improve performance?
How many types of classes are there in c++?
What are default parameters? How are they evaluated in c++ function?