Answer Posted / swapnil
/*To check whethere Entered no. is PRIME or NOT*/
#include<iostream.h>
#include<conio.h>
main()
{
int num,i;
clrscr();
cout<<"Enter the any no.="<<"\n";
cin>>num;
for(i=2;i<=num;i++)
{
if(num%i==0)
{
break;
}
}
if(i==num)
{
cout<<"The number entered is a
PRIME no.";
}
else
{
cout<<"The number entered is NOT a
PRIME no.";
}
getch();
}
Is This Answer Correct ? | 74 Yes | 41 No |
Post New Answer View All Answers
Do inline functions improve performance?
What is runtime polymorphism in c++?
What is :: operator in c++?
What is ios in c++?
What is array in c++ pdf?
What is #include iostream in c++?
What does the ios::ate argument do?
What are c++ tokens?
what is C++ exceptional handling?
Describe exception handling concept with an example?
What is vector processing?
Can you sort a set c++?
Which is the best c++ compiler?
Is ca high or low level language?
What gives the current position of the put pointer?