Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Write an expression that checks if given point (x, y) is inside a circle K({0, 0}, 2).
- using System;
- class PointCircle
- {
- static void Main(string[] args)
- {
- Console.Write("Enter x: ");
- string a = Console.ReadLine();
- double pointX = double.Parse(a);
- Console.Write("Enter y: ");
- string b = Console.ReadLine();
- double pointY = double.Parse(b);
- double total = ((pointX * pointX) + (pointY * pointY));
- if (total <= 4)
- {
- Console.WriteLine("true");
- }
- else
- {
- Console.WriteLine("false");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment