In: Computer Science
using Python
Code:
import math
h=int(input("Enter length of Hypotenuse:"))
if(h==5): #that checks hypotenuse is 5 or not
print("yes,above hypotenuse is 5")
else:
print("the above hypotenuse is not 5")
print()
a=float(input("enter radius of disk:"));
area=3.14*a*a #calculates area of disk
area=round(area,2);
print("Area of disk is",area);
print()
a=int(input("enter x coordinate of center of circle:"))
b=int(input("enter y coordinate of center of circle:"))
r=float(input("Enter radius of circle:"))
x=int(input("enter x coordinate of point:"))
y=int(input("enter y coordinate of point:"))
d=(x-a)*(x-a);
g=(y-b)*(y-b);
w=math.sqrt(d+g)
print()
if(w<r): #checks point is inside or not
print("point(",x,end="")
print(",",y,end="")
print(") is inside the circle")
elif(w==r):
print("point is on the circle")
else:
print("point is outside the circle")
Snippet Code:
Output: