Answer Posted / pramod k sharma
#include<iostream.h>
#include<conio.h>
main()
{
int n,i,f=1;
cout<<"enter any no to check prime";
cin>>n;
for(i=2;i<n;i++)
{
if(n%i==0)
k=2;
}
if(k==2)
cout<<"the no is not prime"<<endl;
else
cout<<"the no is prime";
}
getch();
| Is This Answer Correct ? | 14 Yes | 32 No |
Post New Answer View All Answers
Define the operators that can be used with a pointer.
Which header file allows file i/o with streams a) fileio.h b) iostream.h c) fstream.h
Which bitwise operator is used to check whether a particular bit is on or off?
What is the oldest programming language?
What are static and dynamic type checking?
What is conditions when using boolean operators?
C is to C++ as 1 is to a) What the heck b) 2 c) 10
Is c++ an integer?
What is the difference between structures and unions?
Can recursive program be written in C++?
What is c++ stringstream?
Why pointer is used in c++?
What do the keywords volatile and mean mutable?
What is a hash function c++?
Differentiate between a pointer and a reference with respect to c++.