Twin Primes

A twin prime is a pair of prime numbers that differ by 2. For example, 5 and 7 are twin primes. Also, 11 and 13 are twin primes.

Make a copy of your program that counts the number of primes. Modify the program. The new program should say whether there are twin primes between two values start and stop.

Use the reduction clause with the || operator (logical or) to accomplish this. Each iteration of the for loop should simply check whether i and i+2 are both prime and set a boolean variable to true, if they are. The reduction clause with the || operator will determine if there are any twin primes in the range.

Your program should also report one example of twin primes. Your output should look something like:

Yes, there are twin primes between 1000000 and 2000000. One example is 1999889 and 1999891. or No, there are no twin primes between 20 and 30.