Answer Posted / tuhin pal chowdhury
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
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;
getch();
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
Will c++ be replaced?
What is std :: flush?
What is the difference between interpreters and compilers?
What is c++ try block?
Is C++ case sensitive a) False b) Depends on implementation c) True
How can I learn dev c++ programming?
What is a node class in c++?
total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.
What does floor mean in c++?
what are the characteristics of Class Members in C++?
What are the storage qualifiers?
What is time_t c++?
Why was c++ made?
What is the difference between a declaration and a definition?
What is decltype c++?