Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # program to find max prim of a two numbers
- x = int(input("write your 1st number : "))
- if x == 0:
- print ("1st number equal to zero no prim number is possible")
- exit()
- y = int(input("write your 2nd number : "))
- if y == 0:
- print ("2nd number equal to zero no prim number is possible")
- exit()
- if x == y:
- print ("same number given")
- i = x - 1
- while i > 0:
- if x % i == 0:
- print("max prim is : " + str(i))
- break
- else:
- i -= 1
- else:
- if x > y:
- i = y
- else :
- i = x
- while i > 0:
- if x % i == 0 and y % i == 0:
- print("max prim is : " + str(i))
- break
- else:
- i -= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement