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 is malloc in c++?
what is Loop function? What are different types of Loops?
What is the difference between a "copy constructor" and an "assignment operator" in C++?
What are the methods of exporting a function from a dll?
Are php strings immutable?
What is the full form of c++?
What is do..while loops structure?
how to connect with oracle 9i with server in socket program in c/c++
Describe private, protected and public?
How we can differentiate between a pre and post increment operators during overloading?
What are the different types of polymorphism in c++?
What is the best way to take screenshots of a window with c++ in windows?
Explain the difference between realloc() and free() in c++?
What is called array?
Explain deep copy?