2. Write a program to input two numbers and check whether they are twin prime numbers
or not.
Hint: Twin prime numbers are the prime numbers whose difference is 2.
For example: (5,7), (11,13).
and so on.
Answers
Answered by
8
Answer:
a = int(input("Enter the number")
b = int(input("Enter the other number")
if a%2 !=0 and b%2 !=0 :
if a- b == 2 or a-b == -2:
print ("they are twin primes")
else :
print ("they are not twin primes")
else :
print ("they are not prime numbers")
Answered by
0
Here is your answer mate...
Hope it will help you....
^_^....
Attachments:

Similar questions