Answer Posted / prits
#include <iostream>
using namespace std;
void main()
{
int num;
int flag = 0;
cout<<"enter a number"<<endl;
cin>>num;
for(int i=2;i<num;i++)
{
if((num%i) == 0)
{
flag = 1;
break;
}
}
if (flag == 1)
cout<<"Not Prime"<<endl;
else
cout<<"Prime"<<endl;
}
| Is This Answer Correct ? | 32 Yes | 15 No |
Post New Answer View All Answers
what are the iterator and generic algorithms.
What are c++ redistributables?
Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);
Is c++ a dying language?
Is c++ a float?
Is it possible for a member function to use delete this?
What is the syntax for a for loop?
What is c++ mutable?
What do you mean by persistent and non persistent objects?
Explain the problem with overriding functions
Difference between overloaded functions and overridden functions
Explain queue. How it can be implemented?
What data encapsulation is in c++?
Explain unexpected() function?
Is std :: string immutable?