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
explain sub-type and sub class? atleast u have differ it into 4 points?
What is the difference between procedural programming and oops?
class type to basic type conversion
Which language is pure oop?
Where is pseudocode used?
Where You Can Use Interface in your Project
What does it mean when someone says I oop?
Can enum be null?
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
i got a backdoor offer in process global,Bangalore..Can i work with it?
How do you use inheritance in unity?
What is methods in oop?
Explain the concepts involved in Object Oriented programming.
What is difference between pop and oop?