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

What is constructor in oop?

1118


why reinterpret cast is considered dangerous?

2394


Which method cannot be overridden?

1100


What is cohesion in oop?

1062


What is the point of polymorphism?

1035


What is pointer in oop?

1060


Is react oop?

1073


What is the renewal class?

2763


What are properties in oop?

1090


Why is static class not inherited?

1108


What is difference between pop and oop?

1170


can inline function declare in private part of class?

4417


which feature are not hold visual basic of oop?

2195


Explain virtual inheritance?

1209


What is for loop and its syntax?

1086