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
Differentiate between an array and a list?
Is the declaration of a class its interface or its implementation?
What is the use of :: operator in c++?
What is object oriented programming (oop)?
When are exception objects created?
an operation between an integer and real always yeilds a) integer result b) real result c) float result
What do you mean by funtion prototype?
Can notepad ++ run c++?
What is the use of setfill in c++?
How do I use arrays in c++?
Do class declarations end with a semicolon?
What is an html tag?
What is const in c++?
Define pure virtual function?
Explain what you mean by a pointer.