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
What is iostream in c++ used for?
Is java as fast as c++?
Is it possible to provide special behavior for one instance of a template but not for other instances?
What is the return value of the insertion operator?
Why do we need function?
Explain the register storage classes in c++.
Which software is best for programming?
What is an adaptor class or wrapper class in c++?
Write a program to add three numbers in C++ utilizing classes.
Is c++ free?
How can we read/write Structures from/to data files?
How many types of classes are there in c++?
Can we specify variable field width in a scanf() format string? If possible how?
What does new in c++ do?
Do you know the use of vtable?