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 is an incomplete type in c++?
How would you use qsort() function to sort an array of structures?
Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened
Explain about Virtual Function in C++?
What is a tree in c++?
What is cin clear () in c++?
Array base access faster or pointer base access is faster?
Which sort does c++ use?
What is different in C++, compare with unix?
How many types of classes are there in c++?
Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.
Is rust better than c++?
What are the advantage of using register variables?
What flag means?
What is the sequence of destruction of local objects?