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
Can member data be public?
Where and why do I have to put the "template" and "typename" keywords?
What is a responder chain?
What is pointer -to-members in C++? Give their syntax?
Search for: what is pair in c++?
What is vectorial capacity?
Explain pass by value and pass by reference.
What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required
What is c++ hash?
Write about an iterator class?
Explain about Garbage Collector?
What are the benefits of operator overloading?
Can char be a number c++?
What is the extraction operator and what does it do?
Incase of a function declaration, what is extern means?