A pair of (positive) integer numbers are called twin primes if they are both prime numbers and the difference between them is 2, i.e. they are consecutive odd numbers and they are prime numbers. (3, 5), (5, 7) and (11, 13) are three examples of such pair of twin prime numbers.
Write a program to display all the pairs of twin prime numbers which are less than 100.
Caution: You need to write a program to find and list all the twin primes. Your program should be easily extended to other ranges.
2007-12-26
16:27:02
·
3 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design
It needs to be within the program, and not a function.
Thanks.
2007-12-26
16:33:47 ·
update #1