Answer Posted / md.irfan(rourkela)
#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 ? | 145 Yes | 91 No |
Post New Answer View All Answers
Explain explicit container.
an operation between an integer and real always yeilds a) integer result b) real result c) float result
How are pointers type-cast?
Why do we need constructors in c++?
Can a program run without main?
How do c++ struct differs from the c++ class?
How does atoi function work?
What is time h in c++?
What is static class data?
What is the difference between multiple and multilevel inheritance in c++?
What is implicit pointer in c++?
What are the storage qualifiers?
What will the line of code below print out and why?
What is a c++ object?
What is the copy-and-swap idiom?