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...

1.write a program in C# to find a given point which is
inside in a circle. Given circle's radius and its center
point?
2.Write a program in C# to generated 20 prime numbers
greater than a given number? (It should be more efficient
for large numbers also)
3. Write a Code to check whether a given point is inside a
circle or not? given Circle's raduis and its center point.
4. using oops concept, design an elevator do not forget
buttons on each floor..

Answer Posted / ganesh

take 4 textboxes , cx=centre x, cy=centre y, r=radius,
x=x co-oridnate, y=y co-ordinate.
double d;

calculate the distnace between centre and point taken
if distance less than radius(inside) else outside

simple


d = Math.Sqrt(Math.Pow((int.Parse(cx.Text) - int.Parse(x.Text)), 2) + Math.Pow((int.Parse(cy.Text) - int.Parse(y.Text)), 2));


if (d <Double.Parse( r.Text))
Label1.Text = "inside";
else
Label1.Text = "outside";

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between class and interface in .net?

920


What is class and object c#?

958


Is array a collection c#?

970


Are c# constructors the same as c++ constructors?

999


What do you mean by abstract class in c#?

1030


What is dll file in c#?

1026


What is monitor in C#?

1063


What is the use of console readline () in c#?

913


Which class comes after the SortedList class?

1026


Howmany five tracing levels in System.Diagnostics.TraceSwitcher? Why they are using?

1100


What is namespace c#?

976


Explain the process of inheriting a class into another class?

1052


Why do we need events in c#?

1035


Why do I get a "cs5001: does not have an entry point defined" error when compiling?

1048


What are the properties of c#?

1090