Skip to content

Instantly share code, notes, and snippets.

@mariiaKolokolova
Created April 28, 2020 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariiaKolokolova/4594505bcdbd8cbb7bec2e47efbfa673 to your computer and use it in GitHub Desktop.
Save mariiaKolokolova/4594505bcdbd8cbb7bec2e47efbfa673 to your computer and use it in GitHub Desktop.
package maricka.kolokolova;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int r = 4;
double x;
double y;
System.out.println("Input x:");
x = sc.nextDouble();
System.out.println("Input y:");
y = sc.nextDouble();
if (x * x + y * y <= r * r) {
System.out.println("You are right! Your point is inside the circle.");
} else {
System.out.println("Sorry! Your point is outside the circle.");
}
sc.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment