write a progra in c++ using class & object to find out
wheather a given no. is prim or not.
Answer Posted / rakesh ranjan
#include<conio.h>
void main()
{
int a,i;
printf("enter the number ");
scanf("%d",&a);
for(i=2;i<a;i++)
if(a%i==0)
{
printf("number is not Prime");
break;
}
if(i==a)
printf("Prime number");
getch();
}
| Is This Answer Correct ? | 16 Yes | 6 No |
Post New Answer View All Answers
What is constructor in oop?
why reinterpret cast is considered dangerous?
Which method cannot be overridden?
What is cohesion in oop?
What is the point of polymorphism?
What is pointer in oop?
Is react oop?
What is the renewal class?
What are properties in oop?
Why is static class not inherited?
What is difference between pop and oop?
can inline function declare in private part of class?
which feature are not hold visual basic of oop?
Explain virtual inheritance?
What is for loop and its syntax?