mayap

PointInCircle

Apr 11th, 2014
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace NumberInCircle
  8. {
  9.     class Program
  10.     {
  11.         static void Main()
  12.         {
  13.             int radius = 2;
  14.  
  15.             Console.WriteLine("Enter x coordinate: ");
  16.             double x = double.Parse(Console.ReadLine());
  17.             Console.WriteLine("Enter y coordinate: ");
  18.             double y = double.Parse(Console.ReadLine());
  19.  
  20.             double point = Math.Sqrt(x*x + y*y);
  21.  
  22.             if (point <= radius)
  23.             {
  24.                 Console.WriteLine("Point is in cirlce");
  25.             }
  26.             else
  27.             {
  28.                 Console.WriteLine("Nooooooooo");
  29.             }
  30.  
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment