Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

explain sub-type and sub class? atleast u have differ it into 4 points?

2255


What is the difference between procedural programming and oops?

1056


class type to basic type conversion

2337


Which language is pure oop?

940


Where is pseudocode used?

1028


Where You Can Use Interface in your Project

1834


What does it mean when someone says I oop?

1014


Can enum be null?

963


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?

2332


What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?

2480


i got a backdoor offer in process global,Bangalore..Can i work with it?

2790


How do you use inheritance in unity?

1024


What is methods in oop?

925


Explain the concepts involved in Object Oriented programming.

1142


What is difference between pop and oop?

1071