Answer Posted / darren chang
bool checkPrime(int input)
{
for(int i=2; i<(input/2); i++)
{
if((input%i)==0)
{
return false;
}
}
return true;
}
| Is This Answer Correct ? | 14 Yes | 7 No |
Post New Answer View All Answers
Describe the advantage of an external iterator.
Can you declare an array without a size in c++?
What is difference between rand () and srand ()?
How does the copy constructor differ from the assignment operator (=)?
What is abstraction in c++?
Explain binary search.
What is new in c++?
Define the operators that can be used with a pointer.
Can I have a reference as a data member of a class? If yes, then how do I initialise it?
What is a c++ vector?
Write a function to perform the substraction of two numbers. Eg: char N1="123", N2="478", N3=-355(N1-N2).
What is the full form of stl in c++?
How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?
How does a copy constructor differs from an overloaded assignment operator?
Write about the use of the virtual destructor?