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 are the ways in which a constructors can be called?

2125


What are oops methods?

1000


What is abstraction in oop with example?

1116


What is abstraction oop?

1080


hi all..i want to know oops concepts clearly can any1 explain??

2123


Why is abstraction used?

1089


What is stream in oop?

1297


why reinterpret cast is considered dangerous?

2387


Are polymorphisms mutations?

1155


What is class and object with example?

1125


What is destructor give example?

1049


Why do we use class in oops?

959


Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.

1239


How oops is better than procedural?

1089


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

2460