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
What are pointers used for c++?
What is c++ namespace?
What is c++ prototype?
What is do..while loops structure?
What is java and c++?
What are member functions used in c++?
What is enum class in c++?
What is the basic structure of c++ program?
Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort
Which c++ compiler is best?
How is new() different from malloc()?
What is dynamic and static typing?
Is it possible for a member function to delete the pointer, named this?
Describe the setting up of my member functions to avoid overriding by the derived class?
Define namespace in c++?