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
How does a C++ structure differ from a C++ class?
What is the best c++ book for beginners?
Describe the process of creation and destruction of a derived class object?
What is the average salary of a c++ programmer?
What character terminates all character array strings a) b) . c) END
How do you decide which integer type to use?
Explain the difference between new() and malloc() in c++?
What is the difference between structure and class?
Which c++ compiler is best?
How would you use the functions memcpy(), memset(), memmove()?
Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be
How does java differ from c and c++?
Can a list of string be stored within a two dimensional array?
Can I learn c++ in a week?
What is pointer in c++ with example?