Advertisement
gercho

Point in circle

Nov 8th, 2012
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using System;
  2.  
  3. class PointInCircle
  4. {
  5.     static void Main()
  6.     {
  7.         Console.WriteLine("Enter the \"x\" & \"y\" coordinates: ");
  8.         int x = int.Parse(Console.ReadLine());
  9.         int y = int.Parse(Console.ReadLine());
  10.         int cirleRadius = 5;
  11.         bool result = x * x + y * y <= cirleRadius * cirleRadius;
  12.         Console.WriteLine(result ? "The given cooredinates are within the circle" : "The given cooredinates are outside the circle");
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement