Ok, so, this code snippet is a reply to this thread: http://www.daniweb.com/software-development/cpp/threads/425821/prime-number-c
From what I understood form the OPs request, is that, he wanted an algorihm which would check for prime numbers in a given range, applying these conditions:
a number is to be considered valid if:
a. the number itself is a prime number.
b. the digits composing the number are prime, like this:
37397 is a prime number: 3 is a prime number 37 is a prime number 373 is a prime number 3739 is a prime number
I would not recommend this algorithm thou because it's slow, and is based on multiplications and divisions, and it has a lot of conditions to check.
But, it's a "hard" approach to a given problem.