Advertisement
VyaraG

PointInACircle

Nov 28th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using System;
  2.  
  3. //Write an expression that checks if given podouble (x,  y) is inside a circle K({0, 0}, 2)
  4.  
  5. class PointInACircle
  6. {
  7.     static void Main()
  8.     {
  9.         Console.Write("Enter x: ");
  10.         double x = double.Parse (Console.ReadLine());
  11.         Console.Write ("Enter y: ");
  12.         double y = double.Parse (Console.ReadLine());
  13.         bool isdoubleheCircle = (((x * x) + (y * y)) <= 2 * 2);
  14.         Console.WriteLine(isdoubleheCircle);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement