Answer:
#code in python.
#function that calulate 2 numbers are relatively prime or not
def fun(x,y):
while(y):
x,y=y,x%y
return x
#user input
a=int(input("enter first number:"))
b=int(input("enter second number:"))
#call the function
if(fun(a,b)==1):
print(" Both numbers are Relatively prime")
else:
print("Both numbers are Not relatively prime")
Step-by-step explanation:
Read two numbers from user.Call the function fun() with parameter "a" & "b". In the function, it will perform Euclid algorithm to find the greatest common divisor.If it is 1 then both are relatively prime else both are not relatively prime.
Output:
enter first number:5
enter second number:125
Both numbers are Not relatively prime
enter first number:8
enter second number:9
Both numbers are relatively prime