Twin primes are a pair of prime numbers that differ by 2. For example, 3 and 5

Question:

Twin primes are a pair of prime numbers that differ by 2. For example, 3 and 5 are twin primes, 5 and 7 are twin primes, and 11 and 13 are twin primes. Write a program to find all twin primes less than 1,000. Display the output as follows:
(3, 5)
(5, 7)

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: