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
What do you mean by ‘void’ return type?
C is to C++ as 1 is to a) What the heck b) 2 c) 10
Write a program to find the Fibonacci series recursively.
What is the latest c++ version?
Define 'std'.
You run a shell on unix system. How would you tell which shell are you running?
Explain how to initialize a const member data.
What is the use of typedef?
How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?
Is dev c++ a good compiler?
How many ways can a variable be initialized into in C++?
Name the operators that cannot be overloaded in C++?
Who calls main function?
If dog is a friend of boy and boy is a friend of house, is dog a friend of house?
What does new in c++ do?