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
Whats is abstraction in oops?
Is oop better than procedural?
What is static modifier?
What is byval and byref? What are differences between them?
How can you overcome the diamond problem in inheritance?
What is polymorphism and example?
Can an interface inherit a class?
Why is polymorphism important in oop?
Is html an oop?
Why is polymorphism used?
What do you mean by abstraction?
Why is static class not inherited?
Explain virtual inheritance?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
What are the data types in oop?